RE: page validation in wizzard app

2006-05-08 Thread Yee, Richard K CTR DMDC
in the validator example." -Richard -Original Message- From: Jakub Milkiewicz [mailto:[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> ] Sent: Monday, May 08, 2006 11:20 AM To: Struts Users Mailing List Subject: Re: page validation in wizzard app Hi Richard I have aotovalida

Re: page validation in wizzard app

2006-05-08 Thread Michael Jouravlev
On 5/8/06, Jakub Milkiewicz <[EMAIL PROTECTED]> wrote: Up to now the best soulution ( as i think) is to turn off autovalidation and validate in Action classes calling actionForm validate(). Obviously i will set proper value of page property in each action before validation. Turning off autovali

Re: page validation in wizzard app

2006-05-08 Thread Jakub Milkiewicz
d get a little confusing). Not sure you'd want to change things at this point, but that's one way to approach the problem. Q > -Original Message- > From: Jakub Milkiewicz [mailto:[EMAIL PROTECTED] > Sent: Sunday, May 07, 2006 2:14 PM > To: Struts Users Mailing

Re: page validation in wizzard app

2006-05-08 Thread Jakub Milkiewicz
Hi Richard I have aotovalidation turned on - it means that after reset method of my form bean validate() is called, and if it sucessfull action's execute() is invoked. But whatever i do in validate of my form bean is my business. For me autovalidation means that validate() of form bean is invoked

RE: page validation in wizzard app

2006-05-07 Thread Quinn Stone
lkiewicz [mailto:[EMAIL PROTECTED] > Sent: Sunday, May 07, 2006 2:14 PM > To: Struts Users Mailing List > Subject: Re: page validation in wizzard app > > > Hi Richard. > I can't because of autovalidation. Remember that all my > action have the same > actionForm wh

Re: page validation in wizzard app

2006-05-07 Thread Richard Yee
Jakub, Even though you are using autovalidation, don't you still have a validate() method in your ActionForm that is getting called? Can you alter the page attribute appropriately there (ie. if (errors.size() > 0) page--; -Richard Jakub Milkiewicz wrote: Hi Richard. I can't because of autov

Re: page validation in wizzard app

2006-05-07 Thread Ed Griebel
On 5/7/06, Jakub Milkiewicz <[EMAIL PROTECTED]> wrote: Hi I do not catch it: > name="validation_failed" action="RepopulateAction"/> > I do not think this synax is ok. The is inside of a block in your struts-config.xml, the syntax is approximate and should be enough to give you the idea. T

Re: page validation in wizzard app

2006-05-07 Thread Jakub Milkiewicz
Hi Richard. I can't because of autovalidation. Remember that all my action have the same actionForm which is storred in session. If validation fails i am forwarded to previous action but this action is not even executed cause before this previous action can be invoked validation process occurs. Pa

Re: page validation in wizzard app

2006-05-07 Thread Jakub Milkiewicz
Hi I do not catch it: I do not think this synax is ok. The problem is that i use autovalidation. If validation fails i am forwarded to another action specified by input attribute.Let's call it action2. But action2 is never executed because before its execute() method is invoked.Form bean is

Re: page validation in wizzard app

2006-05-07 Thread Richard Yee
Jakub, Why can't you reset the page attribute to the appropriate value in your Action classes when validation fails. -Richard Richard Yee wrote: Jakub, I think the more elegant solution is to do the validations in the ActionForm validate method and also use a hidden static 'page' variable

Re: page validation in wizzard app

2006-05-07 Thread Ed Griebel
You could have the ActionForward mapped to an Action class in your struts_config.xml file just as easily as a JSP, e.g. and then just 'return ActionForward("validation_failed")' if validation failed on page1. HTH, -ed On 5/6/06, Jakub Milkiewicz <[EMAIL PROTECTED]> wrote: Hi Ed Thanks for an a

Re: page validation in wizzard app

2006-05-06 Thread Jakub Milkiewicz
Hi Ed Thanks for an answer. The problem with your idea is: IF validation fails i can not forward to previous JSP! I need to forward to previous action to prepare me a view - retireve something from DB and put it in . I have the same idea to put form.setPage(pageNo) as first thing in each action. M

Re: page validation in wizzard app

2006-05-06 Thread Jakub Milkiewicz
Hi Thanks for your answer but i do not understand what : hidden static 'page' variable in the JSP Please note that if i submit a form i sent it along with page parameter. And if form is not valid i do not go to any JSP page - i am forwarding to previous ACTION. Because of autovalidation i am

Re: page validation in wizzard app

2006-05-06 Thread Ed Griebel
Hi Jakub- I'm not sure if I fully understand your pageflow, but here goes. I would turn off automatic validation in struts_config.xml. In each action, one of the first things I would do is call form.setPage(pageNo) and then call form.validate(...), and if there are any errors I'd return an Action

Re: page validation in wizzard app

2006-05-06 Thread Richard Yee
Jakub, I think the more elegant solution is to do the validations in the ActionForm validate method and also use a hidden static 'page' variable in the JSP. Your Action.execute method should be fairly small and mainly have code that calls business delegates and that necessary for determining