You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by ravi_eze <ra...@ivycomptech.com> on 2008/07/24 06:50:16 UTC

how to fix Validation isses in a wizard application + Train

hi,

The issue:

1. We have implemented a wizard application (with 4 Steps) with action
variables maintained in session.
2. The pages also have train in the top, i.e. from any step he can jump to
any of the other steps.
3. The Step1, 2,3,4 (mentioned above ) are interdependent i.e. based on
selection in step 1 step 2 is influenced; based on selection in step 2 step
3 is influenced and so on

4. Now: In step 1 user entered wrong value (10000 say) for integer field
which is not allowed by validations. He clicks  on save and page throws
validation exceptions (Expected)
5. He then clicks on train 2 i.e. he is jumping to page 2
6. The page is being displayed based on the incorrect value (100000) which
was rejected by validation of first page. If i use the train again and go
back to the 1st step i still see 10000 there

7. Question: When validation error happens aren't the action variable values
restored to the previous once?(say the prev once  is 10 or 0 i think they
should be reset to 10 or 0 when system throws error at 10000). Is there any
way  in which this can  happen? 

is there any way to call an interceptor/ execute a method after the JSP is
rendered? so that i can restore variables back incase of validation errors.

Please help.

cheers,
ravi 



-- 
View this message in context: http://www.nabble.com/how-to-fix-Validation-isses-in-a-wizard-application-%2B-Train-tp18625361p18625361.html
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: how to fix Validation isses in a wizard application + Train

Posted by ravi_eze <ra...@ivycomptech.com>.
we fixed the issue by writing a trainInterceptor whcih always takes a backup
of the params passed through request and if the action doesnt return errors
deletes them else stores them in session. 

The next pages to which user jumps we are first checking if there are nay
backup objects in session... if yes then restoring them from there. 


-- 
View this message in context: http://www.nabble.com/how-to-fix-Validation-isses-in-a-wizard-application-%2B-Train-tp18625361p18684405.html
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org