You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Martin Liesenberg <ma...@googlemail.com> on 2010/09/28 16:38:13 UTC

radiogroup input validation

Hey *,

I am currently struggling with an issue concerning multiple
radiogroups enclosed in a form and the validation of the input.
Basically the user has to rate his skills on several subjects and then
click a submit button to proceed. The input is then written to the
corresponding variables and stored in a onSuccess method.

My problem is, that if the user forgets to rate his skills on one of
the subjects - so one radiogroup does not get any value - it throws a
ComponentEventException saying Failure writing parameter 'value' of
component.

I was trying to validate the input, with onValidateForm() and
form.getHasErrors() but that did not do the trick.

So my question would be, is there a way to force my user to tick one
field in every radiogroup before proceeding?

Kind regards,

Martin Liesenberg

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: radiogroup input validation

Posted by "Thiago H. de Paula Figueiredo" <th...@gmail.com>.
On Tue, 28 Sep 2010 11:38:13 -0300, Martin Liesenberg  
<ma...@googlemail.com> wrote:

> Hey *,

Hi!

> My problem is, that if the user forgets to rate his skills on one of
> the subjects - so one radiogroup does not get any value - it throws a
> ComponentEventException saying Failure writing parameter 'value' of
> component.

Your bound property is an int, right? This wouldn't happen if it was an  
Integer. Please post the stack trace.
The RadioGroup component supports the required attribute. It should enough  
in your case.

-- 
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,  
and instructor
Owner, Ars Machina Tecnologia da Informação Ltda.
http://www.arsmachina.com.br

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org