Win a copy of Svelte and Sapper in Action this week in the JavaScript forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

using validator with DispatchAction

 
Ranch Hand
Posts: 82
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a class that extends DispatchAction so that i can perform Typical CRUD events (create, retrieve, update, and delete) I am having problems using validator with DispatchAction. I am using DynaActionForm. Is it possible to configure that for create and update perform the form validation and for retrieve and delete not to perform the validation. If so could any help me out.
Thanks in advance.
 
rahul V kumar
Ranch Hand
Posts: 82
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I found one of way doing it and it is helping me solve my purpose. If someone has a better way please let me know.
I have my buttons <html:cancel> instead of <html:submit>
We are supposed to do clean up or perform some function when someone selects <html:cancel> but I am using it to bypass the validation.
Any better way out please let me know. Thanks
 
author
Posts: 114
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
One way to do it is to create separate action-mappings for each CRUD action. Then turn on validation where appropriate. I usually just have a editObject and saveObject action-mapping, where the saveObject mapping has validate="true" and the edit has validate="false".
HTH,
Matt
 
Consider Paul's rocket mass heater.
    Bookmark Topic Watch Topic
  • New Topic