You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by B Manikandan <ma...@wipro.com> on 2001/05/13 13:32:30 UTC

How to set value to radio button/check box dynamically

Hi,
   When a form is loaded how to set the value of radio buttons/check
boxes.
I have a property in my bean whose value has to be set in radio
button/check box.

But,if I use

<html:radio name="domainDomainRelationHolder" property="childGroupOID"
value="childGroupOID"/>

all that Iam getting is  a radio button with value="childGroupOID".But I
need the value of childGroupOID from bean class
DomainDomainRelationHolder as value of my radio button.

Mani





Re: How to set value to radio button/check box dynamically

Posted by Eric Rasmussen <er...@websidestory.com>.
I believe that when you say 'value="childGroupOID"' you are hardcoding the
value to be childGroupOID.

I think what you want is to leave out the value attribute.  This way, the
value will be set to domainDomainRelationHolder.getChildGroupOID().

    - eric

----- Original Message -----
From: "B Manikandan" <ma...@wipro.com>
To: "struts" <st...@jakarta.apache.org>
Sent: Sunday, May 13, 2001 4:32 AM
Subject: How to set value to radio button/check box dynamically


> Hi,
>    When a form is loaded how to set the value of radio buttons/check
> boxes.
> I have a property in my bean whose value has to be set in radio
> button/check box.
>
> But,if I use
>
> <html:radio name="domainDomainRelationHolder" property="childGroupOID"
> value="childGroupOID"/>
>
> all that Iam getting is  a radio button with value="childGroupOID".But I
> need the value of childGroupOID from bean class
> DomainDomainRelationHolder as value of my radio button.
>
> Mani
>
>
>
>
>