• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Validation problem

 
Ranch Hand
Posts: 90
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
When I use valiadtion Framework all the messages are displayed at the same time.Pliz tell me how to dispaly error message one after another.
 
Ranch Hand
Posts: 948
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I don't know a way to do this with the validation framework, but I suppose that if you really wanted this behavior you could implement your own validate methods and return after the first validation error.

- Brent
 
Ranch Hand
Posts: 456
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hey,

should you really want this behaviour (i doubt the users will be thankful), you can parse the detected error messages in the action (before saving them into the request) then delete all but one.

if you are using / mixing with declarative validation, you will need to deactivate it in struts-config and call in manually from your action, otherwise the action.execute() method will not be called if declarative validation returns errors.

(
in the form: implement validate() with super.validate()
in the action: call form.validate()
)

i'm using these technique in my project (without the deletion, of course) and it works perfectly.

hope it helps,
jan
[ January 11, 2007: Message edited by: Jan Groth ]
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic