Problem retrieving id with html: select
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" /&开发者_如何学Gogt;
</html:select>
</td>
...
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>
精彩评论