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

Posted on 2006-05-02
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              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.

Question by:nagaala
    LVL 3

    Accepted Solution


    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

                <td> <input type=radio  name="myRadio" value="<put-accesCode-here>"

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

    Assisted Solution

    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.


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Highfive + Dolby Voice = No More Audio Complaints!

    Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

    This post first appeared at Oracleinaction  ( Anju Garg (Myself). I  will demonstrate that undo for DML’s is stored both in undo tablespace and online redo logs. Then, we will analyze the reaso…
    PRTG Network Monitor lets you monitor your bandwidth usage, so you know who is using up your bandwidth, and what they're using it for.
    Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
    In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor ( If you're interested in additional methods for monitoring bandwidt…

    737 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

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now