Results 1 to 3 of 3
  1. #1
    PiyushDh is offline Member
    Join Date
    Jul 2013
    Posts
    1
    Rep Power
    0

    Default Struts 2.0 Radio button in Table Data

    Hi All, I am new to Struts2.0 and facing below issue

    Issue:- I am not able to get the radio button value or id , in table data,while using Struts 2.

    The page loads up properly and display the data(4 rows), two columns, one file name and other radio button.
    When I right click and view the source code, the value for all the radio button comes same.
    I need to know which radio button is clicked(1st or 2nd, or 3rd....) and I need to pass the data and which radio button was clicked(1,2 etc) to the action class

    below is the jsp page
    quickEntries is the list which is getting iterated and name of file is the file name..The rendering is working fine..

    When I press a button in jsp page ,In Action class I am getting 2 in getSearchTypeRadio() as list is set as 2, whatever the value is set in list(list="2") I am getting that value in action.

    I need to know which radio button was pressed(ie 1,2,3 etc) and that value has to be passed to action class.

    jsp page
    <div id="tableContainer" class="tableContainer95">
    <display:table id="displayTable"
    name="quickEntries"
    class="scrollTable"
    pagesize="20"
    requestURI="">

    <display:column property="nameOfFile"
    titleKey="displayTag.name"/>

    <display:column style="width:50px" titleKey="displayTag.select" >

    <!-- <input type="radio" name="radioButton" value="Select"/> -->

    <td class="form_searchTypes"><s:radio name="searchTypeRadio" labelposition="right" value="%{displaytable.id}}" list="2" />
    </display:column>


    </display:table>

    Thanks a lot

  2. #2
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,413
    Rep Power
    20

    Default Re: Struts 2.0 Radio button in Table Data

    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

  3. #3
    Join Date
    Apr 2014
    Posts
    50
    Rep Power
    0

    Default Re: Struts 2.0 Radio button in Table Data

    here <s:radio name="searchTypeRadio" labelposition="right" value="%{displaytable.id}}" list="2" />

    value is the default value for radio inputs and list is the list of values from which a set of radio inputs are created.

    So what does list="2" mean ?

Similar Threads

  1. radio button
    By gbonecapone in forum New To Java
    Replies: 25
    Last Post: 06-21-2013, 03:23 PM
  2. Struts 2 and <s:radio>
    By KyJavaGuy in forum JavaServer Pages (JSP) and JSTL
    Replies: 0
    Last Post: 03-21-2011, 02:56 PM
  3. Radio Button
    By S-NESH in forum New To Java
    Replies: 6
    Last Post: 02-04-2011, 05:03 PM
  4. Radio Button help!
    By javanator in forum New To Java
    Replies: 3
    Last Post: 04-25-2010, 08:01 PM
  5. Problem with Radio Button on JSP page (esp one row data)
    By DrMath in forum JavaServer Pages (JSP) and JSTL
    Replies: 0
    Last Post: 04-16-2010, 01:48 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •