[EMAIL PROTECTED] wrote:

> Has anyone had luck using radio buttons?
>
> Sharmila
>
> Sharmila Pandith
> Software Engineer
> iXL Inc.
>

Sharmila,

Scanning back through my mailbox, it appears that this question never got
answered.

The idea behind a radio button is that you have a String field that has one of a
fixed set of values, and you want to render one radio button for each of them.
Let's assume that your bean property "gender" can have property values "Male" or
"Female".  You might display them like this:

    <html:radio property="gender" value="Male">
        <bean:message key="gender.male"/>
    </html:radio>

    <html:radio property="gender" value="Female">
        <bean:message key="gender.female"/>
    </html:radio>

A particular radio button will be selected if the value returned for this
property matches the "value" attribute of that button's <html:radio> element.
In the example above, we're also looking up the actual text of the strings
displayed on the HTML page in a message resources bundle, so that it is suitably
internationalized.

If you have any difficulties getting this to work, please post a specific
example.

Craig McClanahan


Reply via email to