Re: How do we repopulate controls when validation fails?
Thanks. It solves my problem :) Franz On Wed, Aug 11, 2010 at 10:11 PM, Alex Rodriguez Lopez < alo...@flordeutopia.pt> wrote: > Don't know if this solves your problem, but maybe it helps to use the > params-prepare-params trick, calling params interceptor twice, so you have > your params ready before prepare(). > > You have an already configured stack, the paramsPrepareParamsStack > > From struts-default.xml: > > > > > > > > > >dojo\..*,^struts\..* > > > > > > > > > >dojo\..*,^struts\..* > > > > name="excludeMethods">input,back,cancel,browse > > > name="excludeMethods">input,back,cancel,browse > > > > > > Hi, >> >> I have read the documentation "How do we repopulate controls when >> validation >> fails" [1]. I tried the action tag solution. However, when there is a >> validation error, the execute method of the action in is not >> called. >> >> I don't choose the Preparable solution because the parameter required is >> not >> ready in the Prepare stage. (For the first time of visit, the parameter is >> set to default.) And I don't want to call the preparation twice in both >> execute and prepare. So what is the best way to repopulate controls for >> normal case and revisit after validation error? Should I abandon to >> validate >> the input in validate method? >> >> Thanks. >> Franz >> >> [1] >> >> http://struts.apache.org/2.x/docs/how-do-we-repopulate-controls-when-validation-fails.html >> >> > - > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org > For additional commands, e-mail: user-h...@struts.apache.org > >
Re: How do we repopulate controls when validation fails?
Don't know if this solves your problem, but maybe it helps to use the params-prepare-params trick, calling params interceptor twice, so you have your params ready before prepare(). You have an already configured stack, the paramsPrepareParamsStack From struts-default.xml: name="excludeParams">dojo\..*,^struts\..* name="excludeParams">dojo\..*,^struts\..* name="excludeMethods">input,back,cancel,browse name="excludeMethods">input,back,cancel,browse Hi, I have read the documentation "How do we repopulate controls when validation fails" [1]. I tried the action tag solution. However, when there is a validation error, the execute method of the action in is not called. I don't choose the Preparable solution because the parameter required is not ready in the Prepare stage. (For the first time of visit, the parameter is set to default.) And I don't want to call the preparation twice in both execute and prepare. So what is the best way to repopulate controls for normal case and revisit after validation error? Should I abandon to validate the input in validate method? Thanks. Franz [1] http://struts.apache.org/2.x/docs/how-do-we-repopulate-controls-when-validation-fails.html - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
How do we repopulate controls when validation fails?
Hi, I have read the documentation "How do we repopulate controls when validation fails" [1]. I tried the action tag solution. However, when there is a validation error, the execute method of the action in is not called. I don't choose the Preparable solution because the parameter required is not ready in the Prepare stage. (For the first time of visit, the parameter is set to default.) And I don't want to call the preparation twice in both execute and prepare. So what is the best way to repopulate controls for normal case and revisit after validation error? Should I abandon to validate the input in validate method? Thanks. Franz [1] http://struts.apache.org/2.x/docs/how-do-we-repopulate-controls-when-validation-fails.html