Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Validation Framework w/ DispatchAction Problem

 
Elle Atechsy
Ranch Hand
Posts: 96
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I've given you all about a week's break. So, here I am again!

I'm using the Validator Framework, DynaValidatorActionForms, & DispatchActions. Since, I'm using the Dyna'Forms, I have the Validator Framework's validator.xml form definition mapped to the ActionMapping's path, instead of the formBean name. And, my ActionMapping validate attribute is set to "true".


The problem is...

For some of my JSP pages, On Load, I need to go to an action class to get values from DB to pre-pop fields in the forms, however, in this particular "page entry" event I do "not" need the Validation Framework to validate.

Would anyone happen to know if there is a way to turn on/off the validate attribute on the ActionMapping? If that cannot be done, is there a way to tell the Validator not to do anything by defining something in the validate.xml?

Any assistance much appreciated.

Thanks,
Lulu
 
alan do
Ranch Hand
Posts: 354
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you can use validwhen (or requiredif) for every single field of the validation. this way is really painful though. i usually have 2 action-mappings mapped to the same DispatchedAction class (2 Actions if you're using Action) and same form-bean. for example:

<action path="/search/entry" name="SearchForm" type="com.my.actions.SearchAction" validate="false" parameter="submitAction"/>
(the validate="false" is optional)

and

<action path="/search/execute" name="SearchForm" type="com.my.actions.SearchAction" validate="true" input="/search/entry.do" parameter="submitAction"/>

obviously, you'd call the /search/entry.do which contains a form mapped to /search/execute.do.
[ May 09, 2005: Message edited by: alan do ]
 
Elle Atechsy
Ranch Hand
Posts: 96
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks! That did the trick!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic