This week's book giveaway is in the Jython/Python forum.
We're giving away four copies of Murach's Python Programming and have Michael Urban and Joel Murach on-line!
See this thread for details.
Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

how to create one validator in a wizard?  RSS feed

 
Peter Primrose
Ranch Hand
Posts: 755
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I have a wizard (4 pages) composed with one form and one action (dispatchAction).I would like to show the end-user the errors on the screen before the user can move to the next page.

Is it possible to achieve this with one form? if I place all restrictions in validate, it will not allow me to move to the next page (since there are fields which were not addressed in the *next* page).

*if not, what other design is recommended?
thanks
 
Merrill Higginson
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can do this by:
  • Having your ActionForm extend ValidatorActionForm instead of ValidatorForm
  • In the validation.xml file, instead of specifying the ActionForm name in as the name attribute of the <form> tag, specify the action path instead
  • Create separate <form> stanzas for each action, each one specifying the fields to be validated for that action.

  • For more information, read the first paragraph of the Struts Validator Guide
    [ February 17, 2007: Message edited by: Merrill Higginson ]
     
    With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
    • Post Reply Bookmark Topic Watch Topic
    • New Topic
    Boost this thread!