开发者

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>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜