views:

28

answers:

1

Hello, I have in my jsp with a table on each line a combo, the problem is that I can not get the value selected in my combo during a submit I think the problem is the definition of property

JSP:

<logic:notEmpty name="gererUtilitaireForm" property="listUtilitaireBean">
                    <%int i=0; %>
                    <logic:iterate id="listUtilitaireBean" name="gererUtilitaireForm" property="listUtilitaireBean" type="com.basesav.beans.UtilitaireBean">                            
                        ...
                            <td>
                                <html:select property="listUtilitaireBean.typeLien" value="<%=typeLien.toString() %>">
                                    <html:optionsCollection name="listUtilitaireBean"   property="listTypeLienDoc" value="idTypeLienDoc" label="libelle" />                           
                                </html:select>                  
                            </td>
...
A: 

To get data from select you should add name property on your html:select. For example:

<logic:notEmpty name="gererUtilitaireForm" property="listUtilitaireBean">
  <% int i = 0; %>
  <logic:iterate id="listUtilitaireBean" name="gererUtilitaireForm" property="listUtilitaireBean" type="com.basesav.beans.UtilitaireBean">
    <td>
      <html:select name="select-row-<%= i %>" property="listUtilitaireBean.typeLien" value="<%=typeLien.toString() %>">
        <html:optionsCollection name="listUtilitaireBean"   property="listTypeLienDoc" value="idTypeLienDoc" label="libelle" />
      </html:select>
    </td>
    <% i++ %>
  </login:iterate>
</login:notEmpty>
Gleb M Borisov
when i saw the source code i have this <select name="select_row_<%=i%>[4].listUtilitaireBean.typeLien">
Mercer