?
Solved

Only java guru can answer (Out of reach of lesser programmers)1000 points for answering

Posted on 2006-05-02
5
Medium Priority
?
272 Views
Last Modified: 2010-04-01
I have  arraylist and I need to populate the arraylist in a jsp.I am using struts so I can use logic iterate of c:foreach  populating is not  a problem for me but you se that I need to accompany a radio buttom with the arraylist the populated field look like this:
 
      choice   student name     number    grade   accesscode
       x              alex               3434        a            wdswwe32

       x              adf                234          b            qwerwqre23
       
       x
     
       x              sdv                2332        f             dfvdsfvdfs21


the choice is a radio button once I select the radio button I must carry the the corresponding row values to the form bean.I.e  the corresponding values are to be placed in the form bean.


0
Comment
Question by:nagaala
2 Comments
 
LVL 3

Accepted Solution

by:
arun_kuttz earned 1000 total points
ID: 16593204

When u are populating your table using c:foreach, make sure the radiobuttons on each row all have the SAME NAME. but set the value to be equal to some uniq key in each row.. probably accesscode.
on page submission, the formbean that is returned by struts will have one property whose name = name of the radibutton and the value will be the accesscode, ull thus be able to know which row was clicked

   <c:foreach.....>
       <tr>
            <td> <input type=radio  name="myRadio" value="<put-accesCode-here>"
            <td>....
        </tr>
   </c:foreach>

-KuTtZ
(PS.. i think this is the second time ur posting this...)
0
 
LVL 10

Assisted Solution

by:radarsh
radarsh earned 1000 total points
ID: 16599529
Hi nagaala,

Use <html:radio/> tag.

Another, crude approach is to use a hidden field for each of your table column and
when you select an option, populate them appropriately and submit.

________
radarsh
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I came across an unsolved Outlook issue and here is my solution.
Exchange administrators are always vigilant about Exchange crashes and disasters that are possible any time. It is quite essential to identify the symptoms of a possible Exchange issue and be prepared with a proper recovery plan. There are multiple…
Whether it be Exchange Server Crash Issues, Dirty Shutdown Errors or Failed to mount error, Stellar Phoenix Mailbox Exchange Recovery has always got your back. With the help of its easy to understand user interface and 3 simple steps recovery proced…
With just a little bit of  SQL and VBA, many doors open to cool things like synchronize a list box to display data relevant to other information on a form.  If you have never written code or looked at an SQL statement before, no problem! ...  give i…
Suggested Courses
Course of the Month17 days, 3 hours left to enroll

864 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question