File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Struts and the fly likes Arraylist in JSP with Html radio Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Arraylist in JSP with Html radio" Watch "Arraylist in JSP with Html radio" New topic

Arraylist in JSP with Html radio

Luke Zechariah
Ranch Hand

Joined: Sep 27, 2005
Posts: 128
I have arraylist in my action and I am storing it as session to display on the jsp page.
request.getSession().setAttribute("asstRqstConcResults", asstRqstResults);

Inside the Arraylist the objects stored are of the Actionform: ConcurrentCaseInfoForm class.

On the jsp I am displaying as follows:

What I am trying to acheive is, when the user selects the radio buttons either accept or reject. I want to store the values(whatever the user selects) and submit the form. That is onclicking "OK"(which is not in the code) button, I want to send the values the user choose to the action. Lets assume an example:

There are seven objects in the arraylist and so seven rows would be displayed. Each row will have an accept and reject radio button, now the user can select accept on one row and could select reject on the other row. Lets says the user selects reject for the 3rd row. So I want my application to associate the reject decision with its information on that row and submit it so that i will know what the user selected. Depending on what the user selected I have to perform the further actions.

I am trying to use javascript but am not able to acheive the requirment. Please see I am using indexed radio buttons by mentioning indexed="true" for selecting the accept or reject.

Please let me know if you have any other suggestions too.

Thank you very much.

Rohit Sharad Sharma

Joined: Jan 14, 2010
Posts: 6
I am not exactly clear with your requirement.
Please correct me if I am wrong... what you want is to select accept or reject corresponding to each row.
Eg if I select reject at row 3 then is I am able to select accept at row 2 or at a time only one radio button in total 7 rows can be selected.
According to your code what I feel that, you would be able to select only 1 radio button from total of 14 (2 * 7) radio buttons.
I agree. Here's the link:
subject: Arraylist in JSP with Html radio
It's not a secret anymore!