I guess he doesnt want to give the user a default value like Yes or No. 
In that case you could use unchecked radio buttons Yes and No instead. If
the user doesn’t decide for either one the field yes should equals to null.

Rene

-----Ursprüngliche Nachricht-----
Von: Rob Hills [mailto:[EMAIL PROTECTED] 
Gesendet: Donnerstag, 29. November 2007 01:33
An: users@appfuse.dev.java.net
Betreff: Re: [appfuse-user] Doubts on checkbox

Hi Yongping,

Yongping wrote:
> I added a checkbox in signup.jsp and let it be required (required="true").
I
> add a field (named as "yes") in User entity but mark it as transient and
> meanwhile define a key like user.yes=xxx in ApplicationResources. Next I
add
> validation rule into User-validation like      
>     <field name="user.yes">
>         <field-validator type="required">
>             <message key="errors.required"/>
>         </field-validator>
>     </field>
> However 
> 1. there is no required indicator (*) showing up on screen page.
> 2. this new rule is not invoked when I didn't check it and hit submit
> button
I'm not sure that "required" actually makes any sense for a checkbox.  
Typically an unticked checkbox doesn't actually return anything in a 
HTTP post anyway.  What do you mean when you "require" a checkbox 
field?  That it is always to be checked?  If so, then perhaps you should 
either not put the checkbox on the page, and simply set that value by 
default in your Action or wherever, or else set it before rendering the 
page and make it read-only.

HTH,
Rob Hills
Waikiki, Western Australia

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to