好像是optionsCollection可以用来写下拉框的东西。
比如:
<html:select size="1" property="deptid">
<html:optionsCollection value="oid" name="employeeForm"
property="departments" label="deptName" />
</html:select>
比如:
<html:select size="1" property="deptid">
<html:optionsCollection value="oid" name="employeeForm"
property="departments" label="deptName" />
</html:select>
解决方案 »
- 关于编码问题,高手指教
- 怎么用jdbc同时连接多个oracle数据库!
- java 动态更新某个类文件的可行性?????
- 关于struts中<html:submit>的问题
- hibernate入门问题,急急急急急急
- 关于路径转换问题(在线等待答案)!!
- 求助!struts2中chain的用法?代码实现
- hibernate collection mapping key问题
- 如何在struts的Action中使用jspSmartUpload
- 想做些比较通用的模块,迷惑中,任何建议都欢迎!
- getJdbcTemplate()返回NULL.求助
- Hibernate中SessionFactory创建失败出现ExceptionInInitializerError异常和
当然这两个集合可以是同一个ListoptionsCollection指定一个集合List<Object>,option的值和文字对应每个object的两个属性
<html:optionsCollection name="selectForm" property="persons" label="name" value="id"/>
</html:select>
html:optionsCollection标签就是一个可以很容易就实现动态下拉列表实现的一个标签--------------------------------------------------------------------------------
html:options标签html:options标签生成多个HTML的option元素。<bean:define id="personCollection" name="selectForm" property="persons"/>
<html:select name="selectForm" property="person.id" size="1">
<html:options collection="personCollection" property="id" labelProperty="name"/>
</html:select><html:select name="selectForm" property="person.id" size="1">
<html:options property="ids" labelProperty="names"/>
</html:select>html:options标签的作用和html:optionsCollection标签的作用基本一样,只是用法上稍有出入