<html:select property="roster.sexP">
<html:option value="">请选择</html:option>
<logic:iterate id="sex" name="cpfyForm" property="sexList">
<bean:define id="sexDefine" type="com.cpfy.rsk.entity.Sex" name="sex" />
<html:option value="<%=sexDefine.getSexId().toString() %>"><%=sexDefine.getSex() %></html:option>
</logic:iterate>
</html:select>
roster是我从form中返回的对象。sexP是一个属性,那么怎么才能让下拉框取得默认值。sexP已经有值的。但是要怎么设置
<html:option value="">请选择</html:option>
<logic:iterate id="sex" name="cpfyForm" property="sexList">
<bean:define id="sexDefine" type="com.cpfy.rsk.entity.Sex" name="sex" />
<html:option value="<%=sexDefine.getSexId().toString() %>"><%=sexDefine.getSex() %></html:option>
</logic:iterate>
</html:select>
roster是我从form中返回的对象。sexP是一个属性,那么怎么才能让下拉框取得默认值。sexP已经有值的。但是要怎么设置
<html:option value=" ">--请选择--</html:option>
<html:options collection="incident_typelist"labelProperty="name"
property="incident_type"/>
</html:select>
或者<html:select name="problemActionForm" property="detailObject.effiect_id" styleId="_Effiect_id" style="width:145px">
<html:optionsCollection name="problemActionForm" property="effiect_idList" label="value" value="code"></html:optionsCollection>
</html:select>
既然值拿到了,那就通过js 判断option 的值是否和传来的值是否相等,若相等就把其select==true就会选中的。