#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2003
    Posts
    10
    Rep Power
    0

    Question logic:iterate html:radio how to pre-selected?


    hello,

    I use this code to generate 3 radio-buttons.

    <logic:iterate id="rowA" collection="<%= fillMenu.getHscTutBelegList() %>" >
    <html:radio property="hsctutbeleg" value="value" idName="rowA"/>
    <font size="1"><bean:write name="rowA" property="label"/></font>
    </logic:iterate>


    the html-output looks like this:

    <input type="radio" name="hsctutbeleg" value="hsc">
    <font size="1">HSC</font>
    <input type="radio" name="hsctutbeleg" value="tut">
    <font size="1">TUT</font>
    <input type="radio" name="hsctutbeleg" value="HSCvsBeleg">
    <font size="1">HSC-Beleg</font>


    when I select a radio-button, is this the output:

    <input type="radio" name="hsctutbeleg" value="hsc" checked="checked">
    <font size="1">HSC</font>
    <input type="radio" name="hsctutbeleg" value="tut">
    <font size="1">TUT</font>
    <input type="radio" name="hsctutbeleg" value="HSCvsBeleg">
    <font size="1">HSC-Beleg</font>


    how can I make a pre-selection to a button that a button is checked, when i load the page?
    in the kind of checked="checked"


    thanks
    martin



    ps:
    as workaround I have write the checked-clause in the source code:

    public ArrayList getHscTutBelegList () {
    this.hscTutBelegList = new ArrayList ();

    hscTutBelegList.add ( new org.apache.struts.util.LabelValueBean ( "HSC",
    "hsc\" checked=\"checked" ) );
    hscTutBelegList.add ( new org.apache.struts.util.LabelValueBean ( "TUT",
    "tut" ) );
    hscTutBelegList.add ( new org.apache.struts.util.LabelValueBean (
    "HSC-Beleg", "HSCvsBeleg" ) );
    return this.hscTutBelegList;

    }
    Last edited by encuesta; December 15th, 2003 at 07:50 AM.
  2. #2
  3. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2004
    Posts
    1
    Rep Power
    0

    Buld radio buttons from collection


    How to schieve the same functionality in Struts 1.0

IMN logo majestic logo threadwatch logo seochat tools logo