[Opensource] Radio button groups

Mike Traum mtraum at cirnetwork.org
Tue Jan 7 14:31:49 PST 2003


You can use expresso's expresso:InputTag (see
http://www.jcorporate.com/econtent/Content.do?state=resource&resource=585#In
putTag) or struts' html:radio (see
http://jakarta.apache.org/struts/doc-1.0.2/struts-html.html#radio).

IMHO, InputTag is better when I'm trying to display a variety of input types
(radio, checkboxes, text) from within a loop or other expresso specific tag
information is stored in the input like a Label (accessed with LabelTag).

html:radio is better when looping through all radio tags or when accessing a
single variable because of the more advanced attributes which give you the
flexibility to set such things as the tab index and javascript events.

sample code:
<table>
<expresso:ElementCollection type="input"> <expresso:ElementIterator> 
      <tr> 
        <td nowrap> <expresso:LabelTag name="ignore" type="input"/> </td>
        <td nowrap> <expresso:InputTag name="ignore"/> </td>
      </tr>
</expresso:ElementIterator> </expresso:ElementCollection>
</table>

<html:radio property="singleInputName" value="1"/>

hth,
mike

-----Original Message-----
From: Soemiaty NCS [mailto:soemiaty at ncs.com.sg]
Sent: Monday, December 30, 2002 11:34 PM
To: 'opensource at jcorporate.com'
Subject: [Opensource] Radio button groups


Hi,

Does anyone have any sample code that make use of the radio button tag using
Struts?

I am working with a form that has zero-to-many rows of inputs, each one
requiring user to select one of two choices.

Soemiaty
_______________________________________________
Opensource mailing list
Opensource at jcorporate.com
http://mail.jcorporate.com/mailman/listinfo/opensource
Archives: http://mail.jcorporate.com/pipermail/opensource/



More information about the Opensource mailing list