Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Passing a string array in var-value

 
Hentay Duke
Ranch Hand
Posts: 198
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've tried google but can't seem to find anything on this.

Is it possible to pass a string array in <var-value>. For example something like this (though this doesn't work).


I want to check if any of the fields I'm passing is filled in. And if so they must all be filled in. I can do seperate checks on each one but then I get mutliple(redundant) error messages, so I'd like to pass the array and loop through it in my validator-rules.xml, therefore only having one standard error message if any of them fail.

Hope this makes sense.

Thanks
 
Brent Sterling
Ranch Hand
Posts: 948
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In general, if I have validation that is slightly complex I just implement the validate method and write it in Java. Be sure to call super.validate.

The validator framework actually calls get methods on your ActionForm, correct? Maybe you could add a getMailingFields method to your form that returns an empty string if any of the fields are empty and then create a validation rule on mailingFields.

If you are using Dynamic forms, then this may not apply.

- Brent
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic