You would not normally use <rule name=required> and <required-message> on the same field. As the first says the field is always required, while the second assumes there is business logic to determine whether the field is required.
john mcnally Stephane Bailliez wrote: > > > -----Original Message----- > > From: Stephane Bailliez > > > > > -----Original Message----- > > > From: John McNally [mailto:[EMAIL PROTECTED]] > > > > > > <required-message> allows you to specify the message that > > > will be shown, > > > if field.setRequired(true) is set and the field is not set. It just > > > allows you to keep your messages in the one location, instead > > > of having > > > some messages in the action or bo.. It is useful if the > > field is not > > > always required. > > > > > > <rule name="required" ... makes the field always required. > > > > > > > mmm...ok, makes sense. thanks. > > > > thinking more... > > <rule name="required">don't do this</rule> > > should normally do the same of <required-message> ? > > > but then is it possible to do this (sorry did no try it yet - > > heading to :): > > > > <rule name="required" value="true"/> > > <required-message>don't do this</required-message> > > Ok, this one does not work and leads to a NPE. > > -- > To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> > For additional commands, e-mail: <mailto:[EMAIL PROTECTED]> -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
