Preselect an option in html:select

Hey,
I am implementing struts in my application. How do i preselect an option in <html:select> tag
here is what i am doing but the option does not get preselected.. the collection below returns A, B , C etc..
<html:select property="accountClass" name="criteriaForm" value ="B" styleClass="selectBoxStyle">
<logic:iterate id="myCollectionElement" collection="<%= Util.getAllClasses() %>">
<html:option value ="<bean:write name="myCollectionElement" />">
<bean:write name="myCollectionElement" /></html:option>
</logic:iterate>     
</html:select>
everything seem to work fine except value "B" in the list box is not preselected.. how do i achieve this??
Thanks
KM

Try using the <html:options> tag.
<html:select property="accountClass" value="B">
    <html:options collection="<%= Util.getAllClasses() %>"
                  property="someValue"
                  labelProperty="someDescription" />
</html:select>

Similar Messages

  • Validating the number of selected options in html:select multiple

    Hi i am trying to validate the maximum number that can be selected from:
    <html:select property="supportingWorkerIds" multiple="true" size="4"
                             tabindex="4">
    <html:optionsCollection property="workerList" label="workerName"
                                  value="userId" />
    </html:select>
    I want the user to not select more that 10 options for this. If its greater than 10 i want to display an error message.
    I have tried adding the following in validation.xml:
    <field property="supportingWorkerIds"
                        indexedListProperty="supportingWorkerIds" depends="validwhen">
    <arg0 key="bookSeminarSessionForm.maxSupportWorkers" />
                        <var>
                             <var-name>test</var-name>
                             <var-value>( supportingWorkerIds.length > 10 )</var-value>
                        </var>
    </field>
    But it doesnt work .
    Any suggestions?
    Thanks in advance

    Hi i am trying to validate the maximum number that can be selected from:
    <html:select property="supportingWorkerIds" multiple="true" size="4"
                             tabindex="4">
    <html:optionsCollection property="workerList" label="workerName"
                                  value="userId" />
    </html:select>
    I want the user to not select more that 10 options for this. If its greater than 10 i want to display an error message.
    I have tried adding the following in validation.xml:
    <field property="supportingWorkerIds"
                        indexedListProperty="supportingWorkerIds" depends="validwhen">
    <arg0 key="bookSeminarSessionForm.maxSupportWorkers" />
                        <var>
                             <var-name>test</var-name>
                             <var-value>( supportingWorkerIds.length > 10 )</var-value>
                        </var>
    </field>
    But it doesnt work .
    Any suggestions?
    Thanks in advance

  • Default UIPicker in UIWebView for html select drop down- too large font.

    Hi everyone,
    The default picker that is used for selecting options from html select tag (drop down) in a UIWebView is cutting off our data.
    I could use labels if it were not in a web view, but can't work out how to adjust the picker used in web view.
    The only way I can think is the detect selection using js, overide the picker with a custom picker and then send selection back to page. Seems complicated so i'm trying to find out if there is an easier/better way?
    The data is quite long so I do need to reduce font size. As there are quite a lot of options the drop down much more suitable to radio buttons for instance.
    I have noted the quick connect framework but seems like an overkill and this is an app that is already live so I don't really want to add a new framework just for an update.
    Any advice?

    Hi K T thanks for your reply
    In the first example of real data that I have used, it is cut off in both orientations. Only one of the options by one character of so but this forces a '...' to be added in the middle and it to be cut off even more.
    Ideally I would like to bring the font size down and make it two lines.
    Cheers

  • The html select box option is not getting displayed properly in IE11

    The html select box option is not getting displayed properly in IE11
    I have developed a website that has a select box drop down. The select box drop down is getting displayed properly in IE9. But in IE11, if I am selecting any option apart from the first one, the whole select box option is getting moved up in the page.
    In IE11, if option 2 is selected, then the select options is getting moved up. But in IE9, if option 2 is selected, then the select options is getting displayed properly.
    Please let me know the fix so that the select options are displayed in the same manner as in IE9.
    Sorry but I am unable to upload images as this site is throwing some error

    Hi Kevin Shen,
    Thanks for post.
    I tried above code in ie 11(version 11.0.9600.17633).
    But it is not working. If you select option 2, and open select box then it open on the select box.
    It should open below the select box.
    Code for above:-
    <select>
    <option>1</option>
    <option>2</option>
    <option>3</option>
    </select>
    Sorry I could not attach screen shot. We have normal select box with three options. If we select option 2, it is showing option list on the select box. It is coming below the select box in ie 10 and other browse like chrome. 
    So what we should do, so that all options will come below the select box?
    Thanks,
    Yogesh Toke

  • How to display html:select in Edit page using same options as in Add page

    Hi,
    <html:select property="tblAssociateDetailsVisaType">
                <html:option value="H1">H1</html:option>
    </html:select>I want small help -
    I have two functionalities 1.add 2.Update
    In Add i have nearly 10 dropdown lists with average 20 options, when i submit into DB stored a single record.
    Now when i want to Edit that same record , i am just getting the value from DB and displaying as <td><html:text property="tblAssociateDetailsVisaType" value="<%=VisaType_page%>" size="10"/> which is a wrong way!
    But, i am struggling in showing the same dropdown list with all the option with the option retrieved from the DB on top with <html:select ..... selected>!
    Please help me how to do ?
    I would like to make you of .properties file in doing so ! Which avoids recompiling!
    Thanks in advance!
    Edited by: ganeshtyarala on Dec 17, 2007 11:57 AM

    You could store all of the options in a collection and then loop through it and compare it to the value that was returned. (collection contains beans with value and label attribute)
    This is the code I use.. it is using JSTL tags, but you could implement the same using other methods.
    When my application loads I query the database to get the possible values for the drop down and then load them into the the form.
    <div class="fieldSpan">
    <select name="rewardTypeCode" id="rewardTypeCode">
              <c:forEach var="rewardTypeCodes" items="${sessionScope.myActivity.rewardTypeCodeList}">
                   <option <c:if test="${sessionScope.myActivity.rewardTypeCode == rewardTypeCodes.value}">selected</c:if>
                        value="${rewardTypeCodes.value}">${rewardTypeCodes.value} - ${rewardTypeCodes.label}</option></c:forEach></select></div>

  • html:select and html:options simple question  - please help

    Hi Friends,
    I am having a problem, please help me .I want to run a query and display all the lastnames of all the users in my database.Here are my files:
    UserForm.java
    public class UserForm extends ActionForm{
         private name firstName;
         private name lastName;
         //all getter and setters
    viewuser.jsp
    <html:select property="lastName">
        <html:options collection="users" property="lastName" labelProperty="lastName" />
    </html:select>
    and my Java Utility class method
    public ArrayList getusers() throws Exception {
             ArrayList aList = new ArrayList();     
              Connection con = ConnectionUtil.getConnection();
              PreparedStatement stmt = null;
              try {
                   stmt = con.prepareStatement("select last_name from USERS);     
                   ResultSet rs = stmt.executeQuery();
                      if (rs.next()) {
                          aList.add(rs.getString(1));
                      }else {
                           return null;
                      rs.close();
                      return aList;
              } catch (SQLException e) {
                   e.printStackTrace();
                   throw new ServiceProcessingException(e.getMessage());
              } finally {
                   ConnectionUtil.closeStatement(stmt);
                   ConnectionUtil.closeConnection(con);
         }My problem is what i need to do in my Action class,so that it sets the "users" variable
    properly and i would be able to read that variable in my jsp and display the lastname
    of all the users.I am tryin this but failing badly:
    public class UserAction extends Action{
      ArrayList userssList = Utility_class_obj.getUsers();
      request.getSession().getServletContext().setAttribute("users", usersList);Please Please help,I would really appreciate your help.
    Thanks

    Thanks a lot friend...this time i made it work my style,next time i will use tha mehod.But I think I am not doing it the right way,please correct me:
    This is the method in my utility class where i run the query and I doubt I am not doing it right here:
    PreparedStatement stmt = null;
    ViewForm vForm = null;
    try {
    stmt = con.prepareStatement("SELECT LAST_NAME FROM   USERS_ADD");     \
    ResultSet rs = stmt.executeQuery();          
    while(rs.next()) {
           vForm = new ViewForm(rs.getString(1));          
          aList.add(vForm);          
       rs.close();
       return aList;          }
    }And I made this constructor in my viewForm class:
    public ViewForm(String lastName){          this.setLastName(lastName);     }I do this in my Action class then:
    ArrayList pList = csDAO.getUsers();  
         if(pList  != null){         
         request.getSession().getServletContext().setAttribute("plist", pList);      
    }And finally this in my jsp:
        <html:select property="lastName"> 
        <html: options collection="plist" property="lastName" labelProperty="lastName" /> And it works,but i don't think I can keep adding constructors to my form class like that,and moreoever if I want to search by first name ,there would be a conflict between 2 constructors,so can someone please tell me the right way to do this.
    Thanks
    Mick

  • Problem with html:select or html:options tags using struts,jsp and tomcat

    Hi
    I'm updating a Struts-Project to a new layout and therefore rework all jsp Sites.
    I'm also using a new Folder-Structure and update therefore my struts-config file.
    My Problem now is:
    Till now, we had a select-field with a code like this:
    < html:form action="/timetableAction" method="POST">
    < table width="53%" border="0">
    < tr>
    < td>< html:radio property="dauer" value="semester"
    /></ td>
    < html:select property="semester" size="1">
    < htmlptions name="semesterList" />
    </ html:select>
    </ html:form>
    The problem now is, that whenever I use any <html:xy> tag, the tomcat server I use can not show the page, he shows just the headers of the template, but not the
    content.-jsp-File where the form would be in. He stops right in the middle of the html page, when he notices the <html:xy> tags.
    And the funny thing is, that he has no problem to show a page when there is a <html:errors> within it? Why could this be? the struts-html.tld File is well included and teh Tomcat Server shows no exceptions.
    Waiting for you answers and thanks

    Thank you, I already got the answer in another forum

  • Html:select doesnt set the form property if there is no option tag

    Hello,
    I have a select box that I am dynamically populating through ajax.
    I have it populated in the create screen. I save the form elements saved. I am able to get the data on a detail screen when i do a bean:write
    But when i try to see the selected element on the edit screen. The bean doesnt get populated
    Here is my code:
         <tr>               
    <td >Region:</td>
         <td>                              <html:select name="matterCreateForm" property="region" styleId="regionListBox">
         </html:select>
         </td>
         </tr>
    Can somebody help me with this. If i do an alert of region in javascript it is empty though the form element has a value.
    If I remove the entire select code and use a html:hidden fot the property. It alerts me with the value.
    Your help is appreciated!
    Thanks
    Priya

    After your SQL SELECT on CO_EditForm.cfm, you need a
    <CFIF> that checks to see if any records were retrieved. See
    below.

  • I have a problem in html:select option

    I need to retrieve the value from the dropdown list of html:select from the formbean .
    As of now its populated with hardcoded values
    Anyhelp appreciated

    I made the changes to the jsp file ...but this time its throwing the following error.
    help me ..
    javax.servlet.jsp.JspException: No getter method available for property selectedCounty for bean under name org.apache.struts.taglib.html.BEAN
         at org.apache.struts.taglib.html.SelectTag.calculateMatchValues(SelectTag.java:327)
         at org.apache.struts.taglib.html.SelectTag.doStartTag(SelectTag.java:244)
         at jsp_servlet.__contract._jspService(__contract.java:245)
         at weblogic.servlet.jsp.JspBase.service(JspBase.java:33)
         at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:1006)
         at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:419)
         at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:463)
         at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:315)
         at weblogic.servlet.internal.RequestDispatcherImpl.forward(RequestDispatcherImpl.java:322)
         at org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1069)
         at org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:455)
         at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:279)
         at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
         at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:1006)
         at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:419)
         at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:315)
         at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:6718)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
         at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
         at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3764)
         at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2644)
         at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:219)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:178)

  • How to get the values from html:select? tag..?

    i tried with this, but its not working...
    <html:select styleClass="text" name="querydefs" property="shortcut"
                 onchange="retrieveOptions()" styleId="firstBox" indexed="true">
    <html:options collection="advanced.choices" property="shortcut" labelProperty="label" />
    </html:select>
                        <td align="left" class="rowcolor1">
                        <script language="javascript" type="text/javascript">
                              function retrieveOptions(){
                             var sel = document.querydefs.options;
                             var selectedOption = sel[sel.selectedIndex].value;
                             document.write(selectedOption);
                           </script>

    <td align="left" class="rowcolor1">
                        <script language="javascript" type="text/javascript">
                              function retrieveOptions(){
                             var sel = document.querydefs.options;
                             var selectedOption = sel[sel.selectedIndex].value;
                             document.write(selectedOption);
                           </script>This java script is not working at all..its not printing anything in document.write();
    This is code..
    <td class="rowcolor1" width="20%">
    <html:select styleClass="text" name="querydefs" property="shortcut"
                             onchange="retrieveSecondOptions()" styleId="firstBox"
                             indexed="true">
                             <html:options collection="advanced.choices" property="shortcut"
                                  labelProperty="label"  />
                        </html:select>i tried with this also. but no use..i'm not the getting the seleced option...
    function retrieveOptions(){
    firstBox = document.getElementById('firstBox');
                             if(firstBox.selectedIndex==0){
          return;
        selectedOption = firstBox.options[firstBox.selectedIndex].value;
    }actually , how to get the values from <html:select> ...?
    my idea is to know which value is selected from the combo box(<html:select> ) if that value is equal some string i have enable a hyperlink to open a popup window

  • Problem in submiting the form onchange of html:select

    I am using WSAD 5.0 and working on a small application with struts.
    I have following code where I want to submit the form if user selects any option from the list. Problem is when i select any option it is giving error that this property is not supported. Following is my code
    <html:form action="/NewUserAction1">
    <tr>
                   <td>
                        <font color="Blue">
                             <b><bean:message key="NewUser1.CountryName" /></b>
                        </font>*
                   </td>
                   <td>
                        <html:select property="state" onchange="submit();">
                             <html:option value="default">select state</html:option>
                             <html:option value="bangalore">Bangalore</html:option>
                             <html:option value="delhi">Delhi</html:option>
                        </html:select>
                   </td>
              </tr>
         </html:form>
    Please help me someone why i am not able to submit the form on onchange event of <html:select>
    Thanks.

    I got the solution :)
    Finally I figured out that
    by default, struts gives <html:submit/> tags a name of
    "submit". Thus there was a namespace collision in the
    form object, with the submit button overriding the
    form's submit method. I fixed the problem by changing
    the name of the submit button. Something like this
    works great:
    <html:submit property="submitPage">
                        <bean:message key="NewUse1.Submit"/>
                   </html:submit></td>
    Now i am able to submit the form.
    Thanks alot.

  • Html select change to make JSP page forward keeping the exsting field value

    Hello, All,
    I am trying to make the change of a selection box in HTML form to reload the page and populate the second selection box based on the value in the first selection box. The content of the second selection box is from database....
    i used a javascript funtion and called it by the onChange(), the onChange redirect the page to the same page. However all my previous input is lost and the second selection box is not populated based on the first selection box.
    The question is how do I keep the current input and reload the page based on the change of a selection box?
    Please help..
    Thanks..
    Here is the code
    <script language=javascript type="text/javascript">
    function forward(){
    location.href="trdCapDetail.jsp";
    </script>
    <select name=vehicle onChange="forward()">
    <%for(int i = 0; i < Vehicle.getAll().size(); i++){
         Vehicle vehicle = (Vehicle)(Vehicle.getAll().elementAt(i));     
         out.write("<option value=" + vehicle.getKey()+" >" + vehicle.getCode() + "</option>");
    %>

    Ok two things.
    1 - you need to submit the value which was selected.
    2 - you need to repopulate the select box with it.
    1 - you need to submit the value which was selected.
    You do this by either appending the parameter to the url, or calling form.submit().
    <script language=javascript type="text/javascript">
    // either set parameter on url manually
    function forward(control){
    var param = control.value;
    location.href="trdCapDetail.jsp?vehicle=" + param;
    // or submit the form:
    function forward(control){
      control.form.submit();
    <% pageContext.setAttribute("vehicles", Vehicle.getAll() ) ; %>
    <form name="myForm" action="trdCapDetail.jsp"> 
      <select name="vehicle" onchange="forward(this)">
          <c:forEach var="vehicle" items="${vehicles}">
            <option value="<c:out value="${vehicle.key}"/>"> <c:out value="${vehicle.code}"/> </option>
          </c:forEach>
       </select>   
    </form>2: populating the control
    One way is to use javascript again:
    <c:if test="${not empty param.vehicle}">
      <script language="javascript">
        document.myForm.vehicle.value = "<c:out value="${param.vehicle}"/>";
      </script>
      </c:if>
    // or scriptlet code if you must
    <%
    String selectedVehicle = request.getParameter("vehicle");
    if (selectedVehicle != null){  %>
      <script language="javascript">
        document.myForm.vehicle.value = "<%= selectedVehicle%>";
      </script>
    <%
    %>The other way to keep the current input is to generate the string "selected" inside the option tag for the selected item. In your loop, check if the current id equals the submitted id, and print "selected" if it is.
    Hope this helps,
    evnafets

  • Passing collection in JSTL html:select onChange event javascript

    I'm trying to pass an object from the form to a javascript function to change text box values when the value of a select field is changed.
    On the jsp page, I have access to the collection called rows.
    I also have an html:select field that I need to use the onChange event to change other fields on the page. I can certainly call a javascript function on the onChange with no problem. But I need to take it one step further. I need to send the javascript function the collection called rows, so I can set other fields' values on the jsp page to the values of the selected row.
    This (or some facimile) is what I want to do:
    <html:select name="currentForm" property="value(id)" onChange="fillUomForm(this.form,this,rows);">
      <c:forEach var="row" items="${rows}">
          <c:choose>
               <c:when test='${row.id == currentForm.stringValues["id"]}'>
                    <option value="<c:out value='${row.id}'/>" selected>
                         <c:out value="${row.id}"/>
                    </option>
               </c:when>
               <c:otherwise>
                     <option value="<c:out value='${row.id}'/>">
                        <c:out value="${row.id}"/>
                     </option>
               </c:otherwise>
           </c:choose>
        </c:forEach>
    </html:select>Of course, rows is not recognized when I try to run this.
    I have tried replacing rows with
    <c:out value='${rows}'/> but that did not work.
    How can I do this?
    thanks,
    Walter

    sigh.
    Another user mixing up JAVA and javaSCRIPT.
    Java runs on the server. It generates an HTML page, and stops running.
    When the client receives the HTML page it can start running javascript.
    The only way java code is run again is if you make another http request. - ie the next time you click a link or submit a form.
    Most of the time that results in reloading a new page.
    You have two options
    1 - Download all the information you might possibly want/need as part of the JSP page. Then the javascript onclick event can retrieve it from javascript memory.
    2 - Make the onchange event submit an HTTP request, and then pick up the response, and do with it what it will. AJAX is a technology that lets you update the page without refreshing it completely.
    Hope this helps,
    evnafets

  • IOS opens the wrong HTML select

    I've got two simple HTML dropdowns menu using the <select>-tag. One is called 'dropdown1' and the other's called 'dropdown2'.
    But, when you tap on 'dropdown2' using an iPhone or iPad, it magically opens up 'dropdown1'. So basically you're unable to change the value of 'dropdown2'.
    It happens in Safari, but also in Google Chrome.
    It works perfect on a desktop, but in Safari 'dropdown2' won't open sometimes.
    The code looks like this:
    € 1,-
    € 100,-
    € 250,-
    € 500,-
    € 1000,-
    € 1500,-
    € 2000,-
    € 2500,-
    € 3000,-
    € 3500,-
    € 4000,-
    € 5000,-
    € 6000,-
    € 7000,-
    € 8000,-
                                      € 1,-
    € 100,-
    € 250,-
    € 500,-
    € 1000,-
    € 1500,-
    € 2000,-
    € 2500,-
    € 3000,-
    € 3500,-
    € 4000,-
    € 5000,-
    € 6000,-
    € 7000,-
    € 8000,- 
    Does anyone know why it's not responding correctly on iOS? (It is tested on iOS 7.1)

    Hi,
    Yes, of course. I'm sorry, I wasn't aware of the fact that it would change the HTML code to actual dropdowns. :-)
    This is the code:
    <select name="dropdown1" id="dropdown1">
                                                <option value="1" selected="selected">&euro; 1,-</option>
                                                <option value="100">&euro; 100,-</option>
                                                <option value="250">&euro; 250,-</option>
                                                <option value="500">&euro; 500,-</option>
                                                <option value="1000">&euro; 1000,-</option>
                                                <option value="1500">&euro; 1500,-</option>
                                                <option value="2000">&euro; 2000,-</option>
                                                <option value="2500">&euro; 2500,-</option>
                                                <option value="3000">&euro; 3000,-</option>
                                                <option value="3500">&euro; 3500,-</option>
                                                <option value="4000">&euro; 4000,-</option>
                                                <option value="5000">&euro; 5000,-</option>
                                                <option value="6000">&euro; 6000,-</option>
                                                <option value="7000">&euro; 7000,-</option>
                                                <option value="8000">&euro; 8000,-</option>
                                      </select><br />
                                      <select name="dropdown2" id="dropdown2">
                                                <option value="1">&euro; 1,-</option>
                                                <option value="100">&euro; 100,-</option>
                                                <option value="250">&euro; 250,-</option>
                                                <option value="500">&euro; 500,-</option>
                                                <option value="1000">&euro; 1000,-</option>
                                                <option value="1500">&euro; 1500,-</option>
                                                <option value="2000">&euro; 2000,-</option>
                                                <option value="2500">&euro; 2500,-</option>
                                                <option value="3000">&euro; 3000,-</option>
                                                <option value="3500" selected="selected">&euro; 3500,-</option>
                                                <option value="4000">&euro; 4000,-</option>
                                                <option value="5000">&euro; 5000,-</option>
                                                <option value="6000">&euro; 6000,-</option>
                                                <option value="7000">&euro; 7000,-</option>
                                                <option value="8000">&euro; 8000,-</option>
                                      </select>
    It's nothing 'special' but it's quite strange that iOS opens 'dropdown1' when tapping on 'dropdown2'.
    Hope you could help me out!

  • Html:select inside logic:iterate

    hi,
    I am having a string type corresponding to the select attribute in my form bean. Since this select tag is inside the logic:iterate all the names of the select boxes are same. i.e myLabel in this context. So, how can i set the value to select box. do i need to change the data type for labelValue in form bean.
    my form bean is given below:
    here the listTotal is the total of the combo and listValue is the individual combo
         public ArrayList listTotal;
         public Collection getListTotal()
              return (Collection)listTotal;
         public void setListTotal(ArrayList total)
              this.listTotal = total;
         public ArrayList listValues;
         public void setListValues(ArrayList values)
                   this.listValues = values;
         public ArrayList getListValues()
              return  listValues;
                         String myLabel;
         public String getMyLabel()
         return myLabel;
         public void setMyLabel(String myLabel)
         this.myLabel = myLabel;
    And i m setting the values in the action class
              ArrayList listTotal = new ArrayList(1);
              ArrayList listValues = new ArrayList();
              listValues.add(new LabelValueBean("k1", "Value1"));
              listValues.add(new LabelValueBean("k2", "Value2"));
              listValues.add(new LabelValueBean("k3", "value3"));
              listTotal.add(listValues);
              listValues = new ArrayList();
              listValues.add(new LabelValueBean("l1", "Value4"));
              listValues.add(new LabelValueBean("l2", "Value5"));
              listValues.add(new LabelValueBean("l3", "value6"));
              listTotal.add(listValues);
              listValues = new ArrayList();
              listValues.add(new LabelValueBean("m1", "Value7"));
              listValues.add(new LabelValueBean("m2", "Value8"));
              listValues.add(new LabelValueBean("m3", "value9"));
              listTotal.add(listValues);
              employeeForm.setListTotal(listTotal);
    jsp code
    <logic:iterate id="listValues" name="EmployeeForm" property="listTotal" indexId="index">
    <tr><td>
    <html:select property="myLabel" >
    <html:options collection="listValues" labelProperty="label" property="value"/>
    </html:select>
    </logic:iterate>

    hi,
    instead of having it as a array i thought of going for an array list so that the manipulation would be much easier. ok here is my code.
        //This is the array list for names of the drop downs.
        private ArrayList selectedList;
        public ArrayList getSelectedList()
            return selectedList;
        public void setSelectedList(ArrayList pselectedList)
           this.selectedList = pselectedList;
        public ListValueVO getSelected(int index)
           return (ListValueVO) selectedList.get(index);
        }I have already mentioned in my previous posts that i have 3 lists in my form bean. One list for individual combo box. Another list for total number of combo boxes. The third list for the names of the combo boxes. Pls let me know whether i m going in the correct direction or not.

Maybe you are looking for