当前位置: 代码迷 >> Java Web开发 >> <html:options/>的有关问题
  详细解决方案

<html:options/>的有关问题

热度:665   发布时间:2016-04-17 12:19:56.0
<html:options/>的问题
各位师兄师姐!给个<html:options/>的应用的简单源码给我看看,尽量详细点
我搞了好久 都搞不透
<td><html:select property="leader" name="departmentFormyzb" style="width:150" >
<html:options collection="leaders"  property="id" labelProperty="name"/>
   </html:select>

------解决方案--------------------
<html:select property="personnelId">
<html:option value="">请选择</html:option>
<html:options collection="personList" property="personId" labelProperty="personName"/>
</html:select>
 html:options自动帮你迭代personList中的内容,前提是personList是Collection类型的,
而且封装的是一个包含personId,personName属性的对象
 property显示的是value,labelProperty显示的是页面看到的内容
  相关解决方案