yes, thats what IFormValidators are for... -igor
On Thu, May 13, 2010 at 7:56 AM, Xavier López <[email protected]> wrote: > Hi, > > I have a Form with some components that are required depending on some other > component's value. Let's put for example a RadioGroup with values City and > Country. There are two DropDownChoices with Cities and Countries, and only > the selected one in the RadioGroup is required. It's important taking into > account the radiogroup is also required. > > Tipically, I've approached this matter by overriding isRequired() on the > DDC's, and querying the RadioGroup input by means of > radiogroup.validate()+radiogroup.getConvertedInput(), in order to return > true or false in the override depending of the input value. > > I don't think that's a good way to do that sort of validation, mainly > because if the radiogroup is not being given any value by the user, the > subsequent calls to radiogroup.validate() on account of the isRequired() > overridings throw up several error messages on that component. > > Is using a FormValidator the best way to perform this kind of validations ? > In general, could it be asserted that when a validation involves two or more > different components it should be put in a FormValidator ? > > I'd appreciate any opinion or commentary about this subject. > > Thanks, > Xavier > --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
