lqxue

常用链接

统计

book

tools

最新评论

html:select 使用

最近使用<html:select>标签,下面是我的一点体会:
1<html:select> 标签一点要嵌套在 <html:form> 标签中使用
2. 必须设置<html:select>的property属性,并且属性的名字要和 YourActionForm 中数据成员名相同,且提供getXXX() 和 setXXX() 方法. 提交表单后 property 属性中存放的就是用户的选择项
3. 下拉框用的是键/值对的模式,因此建议把数据存放在 LabelValueBean 对象中,并把这些对象存放在List中,也方便后续运用;
4. 在<html:select>标签中运用<html:options>来显示数据
   
<html:option collection="存放对象的List"
                          property
="value" 对应值
              LabelProperty
="label" 对应键/>
5. 这样就可以在页面中显示下拉框了

posted on 2007-06-21 00:09 lqx 阅读(3030) 评论(0)  编辑  收藏


只有注册用户登录后才能发表评论。


网站导航: