struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Vidya \(Suvarna\) Mahavadi" <>
Subject RE: Radio button group
Date Tue, 18 Apr 2006 07:59:51 GMT
Thanks Vijay!

-----Original Message-----
From: vijay venkataraman [] 
Sent: Tuesday 18 April 2006 09:23
To: Struts Users Mailing List
Subject: Re: Radio button group


Here is the basic concept and hope you can build on from that.
To make a radio button group, you have to have the names of  radio 
buttons in the group the same.
Say for row one on the table you have to render radio buttons of the
<input type="radio" name="userChoice[0]" value="A"> Accept
<input type="radio" name="userChoice[0]" value="R">  Reject
<input type="radio" name="userChoice[0]" value="I">    Ignore
So above acts as a radio group. Note 'name' of all the input elements 
are the same(userChoice[0]).

So for the second row it will  have to be
<input type="radio" name="userChoice[1]" value="A"> Accept
<input type="radio" name="userChoice[1]" value="R">  Reject
<input type="radio" name="userChoice[1]" value="I">    Ignore

In JSP file it would look like
<html-el:radio property="userChoice[${rowIndex}]"
                    value="A" />
<html-el:radio property="userChoice[${rowIndex}]"
                    value="R" />
<html-el:radio property="userChoice[${rowIndex}]"

You will have to take care to render the appropriate value of "A", "R", 
"I" from the bean. So when the user selects the values will be populated

in to the String[] userChoice

See indexed property usage of struts doc. This 
will give you a idea of how to setup your form bean.

Vijay Venkataraman

Vidya (Suvarna) Mahavadi wrote:

>I am still struggling to find a way out.. Any ideas how to get this
>-----Original Message-----
>From: Vidya (Suvarna) Mahavadi [] 
>Sent: Thursday 13 April 2006 16:37
>To: Struts Users Mailing List
>Subject: Radio button group
>I have a jsp with a table showing few records of data where each record
>corresponds to an object of a bean. Beside the bean data I need to have
>a radio button group with (Approve, Reject and Ignore).
>Can any one help me to put the bean object and the radio button group
>together.. in Jsp and action form.
>Any help is much appreciated.

This message is for the named person's use only. It may contain 
confidential, proprietary or legally privileged information. No
confidentiality or privilege is waived or lost by any mistransmission. 

If you receive this message in error, please immediately delete it and 
all copies of it from your system, destroy any hard copies of it and 
notify the sender. You must not, directly or indirectly, use, disclose, 
distribute, print, or copy any part of this message if you are not the 
intended recipient. 

Lisle Technology Partners Pvt. Ltd. and any of its subsidiaries each 
reserve the right to monitor all e-mail communications through its 

Any views expressed in this message are those of the 
individual sender, except where the message states otherwise and the 
sender is authorized to state them to be the views of any such entity.

To unsubscribe, e-mail:
For additional commands, e-mail:

This message and any attachments are confidential and intended solely for the addressee. If
you have received this message in error, please notify Discovery immediately, telephone number
+27 11 529 2888. Any unauthorised use; alteration or dissemination of the contents of this
email is strictly prohibited. In no event will Discovery or the sender be liable in any manner
whatsoever to any person for any loss or any direct, indirect, special or consequential damages
arising from use of this email or any linked website, including, without limitation, from
any lost profits, business interruption, loss of programmes or other data that may be stored
on any information handling system or otherwise from any assurance that this email is virus
free even if Discovery is expressly advised of the possibility of such damages. Discovery
is an Authorised Financial Services Provider.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message