Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

delayed validation

 
Adam Queens
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am working on multi-page form (wizzard) application usign Struts 1.2.9. User goes from let's say page 1 -> page 2 -> page 3 and then on page 4 we show him/her summary of all the information that they entered on the previous pages.

When the user is presented any of the pages I want to validate the infomation that they entered and show them the error message if they left a require field blank. But if the user wants to continue they can submit the form again without fixing the problem and the next form is displayed. On the summary page I display all of thier errors and make them fix the errors/blank required fields etc. before they submit the final/summary page.

This is very similar to your tax prepration application where if you do not know required information you can continue and fix it later. Anybody knows how to do that in struts because it seems like validator only has required and not required attributes?
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If it's a single session-based ActionForm it might be easier to do the validation manually rather than through XML. One solution for the XML route is to use the validwhen (or whatever it's called) and check both the condition and a per-page token, but I tend to think this would be brittle and too irritating to maintain.

Doing the validation in Java, in a validate method that dispatches to a per-page validation method based on a page token is an option to keep in mind, anyway.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic