Re: [T5.1] AJAX Form Validation
Hi Josh What was your encoding issue? I'm having the same issue here with a SelectBox Encoder. Ro xfile80303 wrote: Thanks Josh! You helped me identify that it was an encoder issue on my end. I appreciate your help. :) Cheers, Levi Josh Canfield wrote: The only change I made was making isValid into a property and a checkbox in the form so I could switch between behaviors. Here is the complete code that works for me. public class Index { @Component private Zone nothingSelectedZone; @Component private Form _parts; @Property private boolean errorVisible; @Property private boolean resultsVisible = true; @Property private boolean _valid; @InjectPage private LoopedForm otherPage; // a random page I have in my experiments project. void onValidateFormFromParts() { if (_valid) { _parts.recordError(No items selected.); } else { resultsVisible = true; _parts.clearErrors(); } errorVisible = _parts.getHasErrors(); } Object onSuccessFromParts() { return otherPage; } Object onFailureFromParts() { return nothingSelectedZone.getBody(); } } ?xml version=1.0 encoding=UTF-8? !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd; html xmlns:t=http://tapestry.apache.org/schema/tapestry_5_0_0.xsd; xmlns=http://www.w3.org/1999/xhtml; xml:lang=en lang=en head titleExperiment Home/title /head body t:zone t:id=nothingSelectedZone id=nothingSelectedZone visible=${errorVisible} No items have been selected. /t:zone t:zone t:id=resultsZone id=resultsZone visible=${resultsVisible} form t:id=parts t:zone=nothingSelectedZone t:checkbox value=valid/ input type=button t:type=submit value=Do It/ /form /t:zone /body /html On Fri, Oct 2, 2009 at 6:03 PM, xfile80303 l...@grokers.net wrote: Hi Josh, Thanks for looking. I'm afraid the stack trace I provided is a red herring and does not have any bearing on the situation. It comes from the fact that my encoder was getting purged from the session due to it being set as FLASH only. And this exception actually only happens after I changed the code from: form t:id=parts t:zone=nothingSelectedZone to form t:id=parts t:zone=resultsZone which actually works... it's as if something in the form needs to be rebuilt after the submit. You say you were able to get my code to work? As is, or did you need to make changes? I'd still like to have the flexibility to refresh the nothingSelectedZone and not touch the resultsZone. Cheers, Levi Josh Canfield wrote: Your example code works fine and the exception you provide makes it look like you're in a loop? Caused by: java.lang.NullPointerException at org.apache.tapestry5.corelib.components.Loop.restoreStateFromStoredClientValue(Loop.java:457) That line from the code: // We assume that if an encoder is available when we rendered, that one will be available // when the form is submitted. Object restoredValue = encoder.toValue(clientValue); Makes me think that you aren't getting an encoder? Can you provide a simple and complete example that breaks? Josh On Fri, Oct 2, 2009 at 4:50 PM, xfile80303 l...@grokers.net wrote: Okay, I have some more information... When I click on the submit button, after the validation error, I see this in the log: ERROR [http-8080-5: RequestExceptionHandler]: Processing of request failed with uncaught exception: org.apache.tapestry5.runtime.ComponentEventException org.apache.tapestry5.runtime.ComponentEventException [at classpath:com/java/dse/cwp/eos/pages/Search.tml, line 106] at org.apache.tapestry5.internal.structure.ComponentPageElementImpl.triggerContextEvent(ComponentPageElementImpl.java:1098) at org.apache.tapestry5.internal.services.AjaxComponentEventRequestHandler.handle(AjaxComponentEventRequestHandler.java:107) at $ComponentEventRequestHandler_12417a4b929.handle($ComponentEventRequestHandler_12417a4b929.java) at org.apache.tapestry5.internal.services.AjaxFilter.handle(AjaxFilter.java:42) at $ComponentEventRequestHandler_12417a4b92b.handle($ComponentEventRequestHandler_12417a4b92b.java) at org.apache.tapestry5.services.TapestryModule$36.handle(TapestryModule.java:2164) at $ComponentEventRequestHandler_12417a4b92b.handle($ComponentEventRequestHandler_12417a4b92b.java) at $ComponentEventRequestHandler_12417a4b911.handle($ComponentEventRequestHandler_12417a4b911.java) at org.apache.tapestry5.internal.services.ComponentRequestHandlerTerminator.handleComponentEvent(ComponentRequestHandlerTerminator.java:43) at
Re: [T5.1] AJAX Form Validation
Hi, I wasn't the one with the problem, and I'm not sure that Levi ever said what was specifically wrong. Post the specifics of your problem in a separate thread and I'm sure someone will be able to help. Josh On Thu, Oct 22, 2009 at 6:23 AM, superslip103 rohit.triv...@db.com wrote: Hi Josh What was your encoding issue? I'm having the same issue here with a SelectBox Encoder. Ro xfile80303 wrote: Thanks Josh! You helped me identify that it was an encoder issue on my end. I appreciate your help. :) Cheers, Levi Josh Canfield wrote: The only change I made was making isValid into a property and a checkbox in the form so I could switch between behaviors. Here is the complete code that works for me. public class Index { @Component private Zone nothingSelectedZone; @Component private Form _parts; @Property private boolean errorVisible; @Property private boolean resultsVisible = true; @Property private boolean _valid; @InjectPage private LoopedForm otherPage; // a random page I have in my experiments project. void onValidateFormFromParts() { if (_valid) { _parts.recordError(No items selected.); } else { resultsVisible = true; _parts.clearErrors(); } errorVisible = _parts.getHasErrors(); } Object onSuccessFromParts() { return otherPage; } Object onFailureFromParts() { return nothingSelectedZone.getBody(); } } ?xml version=1.0 encoding=UTF-8? !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd; html xmlns:t=http://tapestry.apache.org/schema/tapestry_5_0_0.xsd; xmlns=http://www.w3.org/1999/xhtml; xml:lang=en lang=en head titleExperiment Home/title /head body t:zone t:id=nothingSelectedZone id=nothingSelectedZone visible=${errorVisible} No items have been selected. /t:zone t:zone t:id=resultsZone id=resultsZone visible=${resultsVisible} form t:id=parts t:zone=nothingSelectedZone t:checkbox value=valid/ input type=button t:type=submit value=Do It/ /form /t:zone /body /html On Fri, Oct 2, 2009 at 6:03 PM, xfile80303 l...@grokers.net wrote: Hi Josh, Thanks for looking. I'm afraid the stack trace I provided is a red herring and does not have any bearing on the situation. It comes from the fact that my encoder was getting purged from the session due to it being set as FLASH only. And this exception actually only happens after I changed the code from: form t:id=parts t:zone=nothingSelectedZone to form t:id=parts t:zone=resultsZone which actually works... it's as if something in the form needs to be rebuilt after the submit. You say you were able to get my code to work? As is, or did you need to make changes? I'd still like to have the flexibility to refresh the nothingSelectedZone and not touch the resultsZone. Cheers, Levi Josh Canfield wrote: Your example code works fine and the exception you provide makes it look like you're in a loop? Caused by: java.lang.NullPointerException at org.apache.tapestry5.corelib.components.Loop.restoreStateFromStoredClientValue(Loop.java:457) That line from the code: // We assume that if an encoder is available when we rendered, that one will be available // when the form is submitted. Object restoredValue = encoder.toValue(clientValue); Makes me think that you aren't getting an encoder? Can you provide a simple and complete example that breaks? Josh On Fri, Oct 2, 2009 at 4:50 PM, xfile80303 l...@grokers.net wrote: Okay, I have some more information... When I click on the submit button, after the validation error, I see this in the log: ERROR [http-8080-5: RequestExceptionHandler]: Processing of request failed with uncaught exception: org.apache.tapestry5.runtime.ComponentEventException org.apache.tapestry5.runtime.ComponentEventException [at classpath:com/java/dse/cwp/eos/pages/Search.tml, line 106] at org.apache.tapestry5.internal.structure.ComponentPageElementImpl.triggerContextEvent(ComponentPageElementImpl.java:1098) at org.apache.tapestry5.internal.services.AjaxComponentEventRequestHandler.handle(AjaxComponentEventRequestHandler.java:107) at $ComponentEventRequestHandler_12417a4b929.handle($ComponentEventRequestHandler_12417a4b929.java) at org.apache.tapestry5.internal.services.AjaxFilter.handle(AjaxFilter.java:42) at $ComponentEventRequestHandler_12417a4b92b.handle($ComponentEventRequestHandler_12417a4b92b.java) at org.apache.tapestry5.services.TapestryModule$36.handle(TapestryModule.java:2164) at $ComponentEventRequestHandler_12417a4b92b.handle($ComponentEventRequestHandler_12417a4b92b.java) at
Re: [T5.1] AJAX Form Validation
Thanks Josh! You helped me identify that it was an encoder issue on my end. I appreciate your help. :) Cheers, Levi Josh Canfield wrote: The only change I made was making isValid into a property and a checkbox in the form so I could switch between behaviors. Here is the complete code that works for me. public class Index { @Component private Zone nothingSelectedZone; @Component private Form _parts; @Property private boolean errorVisible; @Property private boolean resultsVisible = true; @Property private boolean _valid; @InjectPage private LoopedForm otherPage; // a random page I have in my experiments project. void onValidateFormFromParts() { if (_valid) { _parts.recordError(No items selected.); } else { resultsVisible = true; _parts.clearErrors(); } errorVisible = _parts.getHasErrors(); } Object onSuccessFromParts() { return otherPage; } Object onFailureFromParts() { return nothingSelectedZone.getBody(); } } ?xml version=1.0 encoding=UTF-8? !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd; html xmlns:t=http://tapestry.apache.org/schema/tapestry_5_0_0.xsd; xmlns=http://www.w3.org/1999/xhtml; xml:lang=en lang=en head titleExperiment Home/title /head body t:zone t:id=nothingSelectedZone id=nothingSelectedZone visible=${errorVisible} No items have been selected. /t:zone t:zone t:id=resultsZone id=resultsZone visible=${resultsVisible} form t:id=parts t:zone=nothingSelectedZone t:checkbox value=valid/ input type=button t:type=submit value=Do It/ /form /t:zone /body /html On Fri, Oct 2, 2009 at 6:03 PM, xfile80303 l...@grokers.net wrote: Hi Josh, Thanks for looking. I'm afraid the stack trace I provided is a red herring and does not have any bearing on the situation. It comes from the fact that my encoder was getting purged from the session due to it being set as FLASH only. And this exception actually only happens after I changed the code from: form t:id=parts t:zone=nothingSelectedZone to form t:id=parts t:zone=resultsZone which actually works... it's as if something in the form needs to be rebuilt after the submit. You say you were able to get my code to work? As is, or did you need to make changes? I'd still like to have the flexibility to refresh the nothingSelectedZone and not touch the resultsZone. Cheers, Levi Josh Canfield wrote: Your example code works fine and the exception you provide makes it look like you're in a loop? Caused by: java.lang.NullPointerException at org.apache.tapestry5.corelib.components.Loop.restoreStateFromStoredClientValue(Loop.java:457) That line from the code: // We assume that if an encoder is available when we rendered, that one will be available // when the form is submitted. Object restoredValue = encoder.toValue(clientValue); Makes me think that you aren't getting an encoder? Can you provide a simple and complete example that breaks? Josh On Fri, Oct 2, 2009 at 4:50 PM, xfile80303 l...@grokers.net wrote: Okay, I have some more information... When I click on the submit button, after the validation error, I see this in the log: ERROR [http-8080-5: RequestExceptionHandler]: Processing of request failed with uncaught exception: org.apache.tapestry5.runtime.ComponentEventException org.apache.tapestry5.runtime.ComponentEventException [at classpath:com/java/dse/cwp/eos/pages/Search.tml, line 106] at org.apache.tapestry5.internal.structure.ComponentPageElementImpl.triggerContextEvent(ComponentPageElementImpl.java:1098) at org.apache.tapestry5.internal.services.AjaxComponentEventRequestHandler.handle(AjaxComponentEventRequestHandler.java:107) at $ComponentEventRequestHandler_12417a4b929.handle($ComponentEventRequestHandler_12417a4b929.java) at org.apache.tapestry5.internal.services.AjaxFilter.handle(AjaxFilter.java:42) at $ComponentEventRequestHandler_12417a4b92b.handle($ComponentEventRequestHandler_12417a4b92b.java) at org.apache.tapestry5.services.TapestryModule$36.handle(TapestryModule.java:2164) at $ComponentEventRequestHandler_12417a4b92b.handle($ComponentEventRequestHandler_12417a4b92b.java) at $ComponentEventRequestHandler_12417a4b911.handle($ComponentEventRequestHandler_12417a4b911.java) at org.apache.tapestry5.internal.services.ComponentRequestHandlerTerminator.handleComponentEvent(ComponentRequestHandlerTerminator.java:43) at $ComponentRequestHandler_12417a4b80d.handleComponentEvent($ComponentRequestHandler_12417a4b80d.java) at
Re: [T5.1] AJAX Form Validation
The only change I made was making isValid into a property and a checkbox in the form so I could switch between behaviors. Here is the complete code that works for me. public class Index { @Component private Zone nothingSelectedZone; @Component private Form _parts; @Property private boolean errorVisible; @Property private boolean resultsVisible = true; @Property private boolean _valid; @InjectPage private LoopedForm otherPage; // a random page I have in my experiments project. void onValidateFormFromParts() { if (_valid) { _parts.recordError(No items selected.); } else { resultsVisible = true; _parts.clearErrors(); } errorVisible = _parts.getHasErrors(); } Object onSuccessFromParts() { return otherPage; } Object onFailureFromParts() { return nothingSelectedZone.getBody(); } } ?xml version=1.0 encoding=UTF-8? !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd; html xmlns:t=http://tapestry.apache.org/schema/tapestry_5_0_0.xsd; xmlns=http://www.w3.org/1999/xhtml; xml:lang=en lang=en head titleExperiment Home/title /head body t:zone t:id=nothingSelectedZone id=nothingSelectedZone visible=${errorVisible} No items have been selected. /t:zone t:zone t:id=resultsZone id=resultsZone visible=${resultsVisible} form t:id=parts t:zone=nothingSelectedZone t:checkbox value=valid/ input type=button t:type=submit value=Do It/ /form /t:zone /body /html On Fri, Oct 2, 2009 at 6:03 PM, xfile80303 l...@grokers.net wrote: Hi Josh, Thanks for looking. I'm afraid the stack trace I provided is a red herring and does not have any bearing on the situation. It comes from the fact that my encoder was getting purged from the session due to it being set as FLASH only. And this exception actually only happens after I changed the code from: form t:id=parts t:zone=nothingSelectedZone to form t:id=parts t:zone=resultsZone which actually works... it's as if something in the form needs to be rebuilt after the submit. You say you were able to get my code to work? As is, or did you need to make changes? I'd still like to have the flexibility to refresh the nothingSelectedZone and not touch the resultsZone. Cheers, Levi Josh Canfield wrote: Your example code works fine and the exception you provide makes it look like you're in a loop? Caused by: java.lang.NullPointerException at org.apache.tapestry5.corelib.components.Loop.restoreStateFromStoredClientValue(Loop.java:457) That line from the code: // We assume that if an encoder is available when we rendered, that one will be available // when the form is submitted. Object restoredValue = encoder.toValue(clientValue); Makes me think that you aren't getting an encoder? Can you provide a simple and complete example that breaks? Josh On Fri, Oct 2, 2009 at 4:50 PM, xfile80303 l...@grokers.net wrote: Okay, I have some more information... When I click on the submit button, after the validation error, I see this in the log: ERROR [http-8080-5: RequestExceptionHandler]: Processing of request failed with uncaught exception: org.apache.tapestry5.runtime.ComponentEventException org.apache.tapestry5.runtime.ComponentEventException [at classpath:com/java/dse/cwp/eos/pages/Search.tml, line 106] at org.apache.tapestry5.internal.structure.ComponentPageElementImpl.triggerContextEvent(ComponentPageElementImpl.java:1098) at org.apache.tapestry5.internal.services.AjaxComponentEventRequestHandler.handle(AjaxComponentEventRequestHandler.java:107) at $ComponentEventRequestHandler_12417a4b929.handle($ComponentEventRequestHandler_12417a4b929.java) at org.apache.tapestry5.internal.services.AjaxFilter.handle(AjaxFilter.java:42) at $ComponentEventRequestHandler_12417a4b92b.handle($ComponentEventRequestHandler_12417a4b92b.java) at org.apache.tapestry5.services.TapestryModule$36.handle(TapestryModule.java:2164) at $ComponentEventRequestHandler_12417a4b92b.handle($ComponentEventRequestHandler_12417a4b92b.java) at $ComponentEventRequestHandler_12417a4b911.handle($ComponentEventRequestHandler_12417a4b911.java) at org.apache.tapestry5.internal.services.ComponentRequestHandlerTerminator.handleComponentEvent(ComponentRequestHandlerTerminator.java:43) at $ComponentRequestHandler_12417a4b80d.handleComponentEvent($ComponentRequestHandler_12417a4b80d.java) at org.apache.tapestry5.internal.services.ComponentEventDispatcher.dispatch(ComponentEventDispatcher.java:46) at $Dispatcher_12417a4b819.dispatch($Dispatcher_12417a4b819.java) at $Dispatcher_12417a4b80a.dispatch($Dispatcher_12417a4b80a.java) at
Re: [T5.1] AJAX Form Validation
Okay, I have some more information... When I click on the submit button, after the validation error, I see this in the log: ERROR [http-8080-5: RequestExceptionHandler]: Processing of request failed with uncaught exception: org.apache.tapestry5.runtime.ComponentEventException org.apache.tapestry5.runtime.ComponentEventException [at classpath:com/java/dse/cwp/eos/pages/Search.tml, line 106] at org.apache.tapestry5.internal.structure.ComponentPageElementImpl.triggerContextEvent(ComponentPageElementImpl.java:1098) at org.apache.tapestry5.internal.services.AjaxComponentEventRequestHandler.handle(AjaxComponentEventRequestHandler.java:107) at $ComponentEventRequestHandler_12417a4b929.handle($ComponentEventRequestHandler_12417a4b929.java) at org.apache.tapestry5.internal.services.AjaxFilter.handle(AjaxFilter.java:42) at $ComponentEventRequestHandler_12417a4b92b.handle($ComponentEventRequestHandler_12417a4b92b.java) at org.apache.tapestry5.services.TapestryModule$36.handle(TapestryModule.java:2164) at $ComponentEventRequestHandler_12417a4b92b.handle($ComponentEventRequestHandler_12417a4b92b.java) at $ComponentEventRequestHandler_12417a4b911.handle($ComponentEventRequestHandler_12417a4b911.java) at org.apache.tapestry5.internal.services.ComponentRequestHandlerTerminator.handleComponentEvent(ComponentRequestHandlerTerminator.java:43) at $ComponentRequestHandler_12417a4b80d.handleComponentEvent($ComponentRequestHandler_12417a4b80d.java) at org.apache.tapestry5.internal.services.ComponentEventDispatcher.dispatch(ComponentEventDispatcher.java:46) at $Dispatcher_12417a4b819.dispatch($Dispatcher_12417a4b819.java) at $Dispatcher_12417a4b80a.dispatch($Dispatcher_12417a4b80a.java) at org.apache.tapestry5.services.TapestryModule$RequestHandlerTerminator.service(TapestryModule.java:245) at org.apache.tapestry5.internal.services.RequestErrorFilter.service(RequestErrorFilter.java:26) at $RequestHandler_12417a4b80b.service($RequestHandler_12417a4b80b.java) at org.apache.tapestry5.services.TapestryModule$4.service(TapestryModule.java:778) at $RequestHandler_12417a4b80b.service($RequestHandler_12417a4b80b.java) at org.apache.tapestry5.services.TapestryModule$3.service(TapestryModule.java:767) at $RequestHandler_12417a4b80b.service($RequestHandler_12417a4b80b.java) at org.apache.tapestry5.internal.services.StaticFilesFilter.service(StaticFilesFilter.java:85) at $RequestHandler_12417a4b80b.service($RequestHandler_12417a4b80b.java) at com.java.dse.cwp.eos.services.EosModule$1.service(EosModule.java:254) at $RequestFilter_12417a4b806.service($RequestFilter_12417a4b806.java) at $RequestHandler_12417a4b80b.service($RequestHandler_12417a4b80b.java) at org.apache.tapestry5.internal.services.CheckForUpdatesFilter$2.invoke(CheckForUpdatesFilter.java:90) at org.apache.tapestry5.internal.services.CheckForUpdatesFilter$2.invoke(CheckForUpdatesFilter.java:81) at org.apache.tapestry5.ioc.internal.util.ConcurrentBarrier.withRead(ConcurrentBarrier.java:85) at org.apache.tapestry5.internal.services.CheckForUpdatesFilter.service(CheckForUpdatesFilter.java:103) at $RequestHandler_12417a4b80b.service($RequestHandler_12417a4b80b.java) at $RequestHandler_12417a4b800.service($RequestHandler_12417a4b800.java) at org.apache.tapestry5.services.TapestryModule$HttpServletRequestHandlerTerminator.service(TapestryModule.java:197) at org.apache.tapestry5.internal.gzip.GZipFilter.service(GZipFilter.java:53) at $HttpServletRequestHandler_12417a4b802.service($HttpServletRequestHandler_12417a4b802.java) at org.apache.tapestry5.internal.services.IgnoredPathsFilter.service(IgnoredPathsFilter.java:62) at $HttpServletRequestFilter_12417a4b7ff.service($HttpServletRequestFilter_12417a4b7ff.java) at $HttpServletRequestHandler_12417a4b802.service($HttpServletRequestHandler_12417a4b802.java) at org.apache.tapestry5.services.TapestryModule$2.service(TapestryModule.java:726) at $HttpServletRequestHandler_12417a4b802.service($HttpServletRequestHandler_12417a4b802.java) at $HttpServletRequestHandler_12417a4b7fd.service($HttpServletRequestHandler_12417a4b7fd.java) at org.apache.tapestry5.TapestryFilter.doFilter(TapestryFilter.java:127) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128) at
Re: [T5.1] AJAX Form Validation
Your example code works fine and the exception you provide makes it look like you're in a loop? Caused by: java.lang.NullPointerException at org.apache.tapestry5.corelib.components.Loop.restoreStateFromStoredClientValue(Loop.java:457) That line from the code: // We assume that if an encoder is available when we rendered, that one will be available // when the form is submitted. Object restoredValue = encoder.toValue(clientValue); Makes me think that you aren't getting an encoder? Can you provide a simple and complete example that breaks? Josh On Fri, Oct 2, 2009 at 4:50 PM, xfile80303 l...@grokers.net wrote: Okay, I have some more information... When I click on the submit button, after the validation error, I see this in the log: ERROR [http-8080-5: RequestExceptionHandler]: Processing of request failed with uncaught exception: org.apache.tapestry5.runtime.ComponentEventException org.apache.tapestry5.runtime.ComponentEventException [at classpath:com/java/dse/cwp/eos/pages/Search.tml, line 106] at org.apache.tapestry5.internal.structure.ComponentPageElementImpl.triggerContextEvent(ComponentPageElementImpl.java:1098) at org.apache.tapestry5.internal.services.AjaxComponentEventRequestHandler.handle(AjaxComponentEventRequestHandler.java:107) at $ComponentEventRequestHandler_12417a4b929.handle($ComponentEventRequestHandler_12417a4b929.java) at org.apache.tapestry5.internal.services.AjaxFilter.handle(AjaxFilter.java:42) at $ComponentEventRequestHandler_12417a4b92b.handle($ComponentEventRequestHandler_12417a4b92b.java) at org.apache.tapestry5.services.TapestryModule$36.handle(TapestryModule.java:2164) at $ComponentEventRequestHandler_12417a4b92b.handle($ComponentEventRequestHandler_12417a4b92b.java) at $ComponentEventRequestHandler_12417a4b911.handle($ComponentEventRequestHandler_12417a4b911.java) at org.apache.tapestry5.internal.services.ComponentRequestHandlerTerminator.handleComponentEvent(ComponentRequestHandlerTerminator.java:43) at $ComponentRequestHandler_12417a4b80d.handleComponentEvent($ComponentRequestHandler_12417a4b80d.java) at org.apache.tapestry5.internal.services.ComponentEventDispatcher.dispatch(ComponentEventDispatcher.java:46) at $Dispatcher_12417a4b819.dispatch($Dispatcher_12417a4b819.java) at $Dispatcher_12417a4b80a.dispatch($Dispatcher_12417a4b80a.java) at org.apache.tapestry5.services.TapestryModule$RequestHandlerTerminator.service(TapestryModule.java:245) at org.apache.tapestry5.internal.services.RequestErrorFilter.service(RequestErrorFilter.java:26) at $RequestHandler_12417a4b80b.service($RequestHandler_12417a4b80b.java) at org.apache.tapestry5.services.TapestryModule$4.service(TapestryModule.java:778) at $RequestHandler_12417a4b80b.service($RequestHandler_12417a4b80b.java) at org.apache.tapestry5.services.TapestryModule$3.service(TapestryModule.java:767) at $RequestHandler_12417a4b80b.service($RequestHandler_12417a4b80b.java) at org.apache.tapestry5.internal.services.StaticFilesFilter.service(StaticFilesFilter.java:85) at $RequestHandler_12417a4b80b.service($RequestHandler_12417a4b80b.java) at com.java.dse.cwp.eos.services.EosModule$1.service(EosModule.java:254) at $RequestFilter_12417a4b806.service($RequestFilter_12417a4b806.java) at $RequestHandler_12417a4b80b.service($RequestHandler_12417a4b80b.java) at org.apache.tapestry5.internal.services.CheckForUpdatesFilter$2.invoke(CheckForUpdatesFilter.java:90) at org.apache.tapestry5.internal.services.CheckForUpdatesFilter$2.invoke(CheckForUpdatesFilter.java:81) at org.apache.tapestry5.ioc.internal.util.ConcurrentBarrier.withRead(ConcurrentBarrier.java:85) at org.apache.tapestry5.internal.services.CheckForUpdatesFilter.service(CheckForUpdatesFilter.java:103) at $RequestHandler_12417a4b80b.service($RequestHandler_12417a4b80b.java) at $RequestHandler_12417a4b800.service($RequestHandler_12417a4b800.java) at org.apache.tapestry5.services.TapestryModule$HttpServletRequestHandlerTerminator.service(TapestryModule.java:197) at org.apache.tapestry5.internal.gzip.GZipFilter.service(GZipFilter.java:53) at $HttpServletRequestHandler_12417a4b802.service($HttpServletRequestHandler_12417a4b802.java) at org.apache.tapestry5.internal.services.IgnoredPathsFilter.service(IgnoredPathsFilter.java:62) at $HttpServletRequestFilter_12417a4b7ff.service($HttpServletRequestFilter_12417a4b7ff.java) at $HttpServletRequestHandler_12417a4b802.service($HttpServletRequestHandler_12417a4b802.java) at org.apache.tapestry5.services.TapestryModule$2.service(TapestryModule.java:726) at $HttpServletRequestHandler_12417a4b802.service($HttpServletRequestHandler_12417a4b802.java) at
Re: [T5.1] AJAX Form Validation
Hi Josh, Thanks for looking. I'm afraid the stack trace I provided is a red herring and does not have any bearing on the situation. It comes from the fact that my encoder was getting purged from the session due to it being set as FLASH only. And this exception actually only happens after I changed the code from: form t:id=parts t:zone=nothingSelectedZone to form t:id=parts t:zone=resultsZone which actually works... it's as if something in the form needs to be rebuilt after the submit. You say you were able to get my code to work? As is, or did you need to make changes? I'd still like to have the flexibility to refresh the nothingSelectedZone and not touch the resultsZone. Cheers, Levi Josh Canfield wrote: Your example code works fine and the exception you provide makes it look like you're in a loop? Caused by: java.lang.NullPointerException at org.apache.tapestry5.corelib.components.Loop.restoreStateFromStoredClientValue(Loop.java:457) That line from the code: // We assume that if an encoder is available when we rendered, that one will be available // when the form is submitted. Object restoredValue = encoder.toValue(clientValue); Makes me think that you aren't getting an encoder? Can you provide a simple and complete example that breaks? Josh On Fri, Oct 2, 2009 at 4:50 PM, xfile80303 l...@grokers.net wrote: Okay, I have some more information... When I click on the submit button, after the validation error, I see this in the log: ERROR [http-8080-5: RequestExceptionHandler]: Processing of request failed with uncaught exception: org.apache.tapestry5.runtime.ComponentEventException org.apache.tapestry5.runtime.ComponentEventException [at classpath:com/java/dse/cwp/eos/pages/Search.tml, line 106] at org.apache.tapestry5.internal.structure.ComponentPageElementImpl.triggerContextEvent(ComponentPageElementImpl.java:1098) at org.apache.tapestry5.internal.services.AjaxComponentEventRequestHandler.handle(AjaxComponentEventRequestHandler.java:107) at $ComponentEventRequestHandler_12417a4b929.handle($ComponentEventRequestHandler_12417a4b929.java) at org.apache.tapestry5.internal.services.AjaxFilter.handle(AjaxFilter.java:42) at $ComponentEventRequestHandler_12417a4b92b.handle($ComponentEventRequestHandler_12417a4b92b.java) at org.apache.tapestry5.services.TapestryModule$36.handle(TapestryModule.java:2164) at $ComponentEventRequestHandler_12417a4b92b.handle($ComponentEventRequestHandler_12417a4b92b.java) at $ComponentEventRequestHandler_12417a4b911.handle($ComponentEventRequestHandler_12417a4b911.java) at org.apache.tapestry5.internal.services.ComponentRequestHandlerTerminator.handleComponentEvent(ComponentRequestHandlerTerminator.java:43) at $ComponentRequestHandler_12417a4b80d.handleComponentEvent($ComponentRequestHandler_12417a4b80d.java) at org.apache.tapestry5.internal.services.ComponentEventDispatcher.dispatch(ComponentEventDispatcher.java:46) at $Dispatcher_12417a4b819.dispatch($Dispatcher_12417a4b819.java) at $Dispatcher_12417a4b80a.dispatch($Dispatcher_12417a4b80a.java) at org.apache.tapestry5.services.TapestryModule$RequestHandlerTerminator.service(TapestryModule.java:245) at org.apache.tapestry5.internal.services.RequestErrorFilter.service(RequestErrorFilter.java:26) at $RequestHandler_12417a4b80b.service($RequestHandler_12417a4b80b.java) at org.apache.tapestry5.services.TapestryModule$4.service(TapestryModule.java:778) at $RequestHandler_12417a4b80b.service($RequestHandler_12417a4b80b.java) at org.apache.tapestry5.services.TapestryModule$3.service(TapestryModule.java:767) at $RequestHandler_12417a4b80b.service($RequestHandler_12417a4b80b.java) at org.apache.tapestry5.internal.services.StaticFilesFilter.service(StaticFilesFilter.java:85) at $RequestHandler_12417a4b80b.service($RequestHandler_12417a4b80b.java) at com.java.dse.cwp.eos.services.EosModule$1.service(EosModule.java:254) at $RequestFilter_12417a4b806.service($RequestFilter_12417a4b806.java) at $RequestHandler_12417a4b80b.service($RequestHandler_12417a4b80b.java) at org.apache.tapestry5.internal.services.CheckForUpdatesFilter$2.invoke(CheckForUpdatesFilter.java:90) at org.apache.tapestry5.internal.services.CheckForUpdatesFilter$2.invoke(CheckForUpdatesFilter.java:81) at org.apache.tapestry5.ioc.internal.util.ConcurrentBarrier.withRead(ConcurrentBarrier.java:85) at org.apache.tapestry5.internal.services.CheckForUpdatesFilter.service(CheckForUpdatesFilter.java:103) at $RequestHandler_12417a4b80b.service($RequestHandler_12417a4b80b.java) at $RequestHandler_12417a4b800.service($RequestHandler_12417a4b800.java) at