>>>>> "Naveen" == Naveen Veluri <Veluri> writes:

    Naveen> Hi,
    Naveen>  I was using struts 1.0 beta version for my application and I couldn't 
check
    Naveen> or select the radio button on my JSP
    Naveen> The radio button is a string in my form bean and I want to select that 
based
    Naveen> on checked or selected that I give for it.

    Naveen> If anyone can give me the syntax for using the tag(Just like HTML tag for
    Naveen> checked=true or something similar in struts version) 
    Naveen> in html <input type=radio value="XXX" checked> should work alright but I
    Naveen> wanted to know the similar syntax in case of struts for getting the radio
    Naveen> selected.
    Naveen> I do not want to initialize the value on the constructor for FormBean as
    Naveen> this value needs to come from my back-end database and I need to populate
    Naveen> this on JSP based on boolean value for one of my entity.

    Naveen> I would appreciate your help.

The "html:radio" component is essentially "rendered" from a property of a bean,
both of which you specify in the attributes of "html:radio" (the "name"
attribute specifies the bean, and the "property" attribute specifies the
property of the bean to use).

When the HTML component is generated, the RadioTag compares the value of your
"value" attribute with the current value of the bean property.  If they are
equal, it will insert the "checked=\"checked\"" string.

-- 
===================================================================
David M. Karr          ; Best Consulting
[EMAIL PROTECTED]   ; Java/Unix/XML/C++/X ; BrainBench CJ12P (#12004)


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

Reply via email to