CSDN首页 空间 新闻 论坛 Blog 下载 读书 网摘 搜索 .NET Java 视频 接项目 求职 在线学习 买书 程序员 通知
不看会后悔的Windows XP之经验谈 简单快捷DIY实用家庭影院
CSDN社区
搜索 收藏 打印 关闭
CSDN社区 >  Java >  J2SE / 基础类

???關於STRUTS MULTIBOX怎麼使用?有誰知道嗎?幫幫忙啦

楼主zhoucloud(没有)2005-06-04 12:15:19 在 Java / J2SE / 基础类 提问

急急急~~~~~搞了幾天沒搞出來,大家知道的教教我,謝謝 问题点数:0、回复次数:4Top

1 楼caiyi0903(willpower)回复于 2005-06-04 12:26:21 得分 0

Renders   an   HTML   <input>   element   of   type   checkbox,   whose   "checked"   status   is   initialized   based   on   whether   the   specified   value   matches   one   of   the   elements   of   the   underlying   property's   array   of   current   values.   This   element   is   useful   when   you   have   large   numbers   of   checkboxes,   and   prefer   to   combine   the   values   into   a   single   array-valued   property   instead   of   multiple   boolean   properties.   This   tag   is   only   valid   when   nested   inside   a   form   tag   body.  
   
  WARNING:   In   order   to   correctly   recognize   cases   where   none   of   the   associated   checkboxes   are   selected,   the   ActionForm   bean   associated   with   this   form   must   include   a   statement   setting   the   corresponding   array   to   zero   length   in   the   reset()   method.  
   
  The   value   to   be   returned   to   the   server,   if   this   checkbox   is   selected,   must   be   defined   by   one   of   the   following   methods:  
   
  Specify   a   value   attribute,   whose   contents   will   be   used   literally   as   the   value   to   be   returned.    
  Specify   no   value   attribute,   and   the   nested   body   content   of   this   tag   will   be   used   as   the   value   to   be   returnedTop

2 楼laughsmile(海边的星空)回复于 2005-06-04 17:08:50 得分 0

<html:multibox   name="FormBean的名称"   property="Formbean的属性">显示的标签  
  </html:multibox>Top

3 楼Dantee(奋斗中。。。)回复于 2005-06-04 17:29:33 得分 0

将Form里的对应属性设为数组就好,会在页面提交的时候把选中的box依次存入数组内的,例如:  
   
   
  Form中:  
   
  String[]   aa;   及其setter   和   getter方法  
   
   
  页面上:  
  <html:multibox   name="Form"   property="aa">这里是构选后赋给aa的值</html:multibox>  
  还有另一种写法:  
  <html:multibox   name="Form"   property="aa"   value="这里是构选后赋给aa的值"/>  
   
  Top

4 楼xuelei81(阿薛)回复于 2005-06-04 20:24:30 得分 0

1、你对应的FormBean需要有一个与multibox的property一样名字的String[]类型的属性,如String[]   test  
   
  2、在你的jsp里写<html:multibox   property="test"   value="1">试验</html:multibox>Top

相关问题

  • jbuilder 使用struts
  • STRUTS中怎么使用两个资源文件?
  • struts包裏的類不能使用是怎麽回事?
  • 请怎么使用Struts的缺省错误处理?
  • 基于Struts的.war应用程序怎么使用?
  • 在resin里面怎么导入struts,resin和struts结合使用稳定吗???
  • struts中的session的使用!
  • struts使用oracle的问题
  • Struts标签使用问题
  • Struts <html:errors/>使用问题

关键词

  • checkbox
  • specify
  • array
  • property
  • element
  • form

得分解答快速导航

  • 帖主:zhoucloud

相关链接

  • CSDN Java频道
  • Java类图书
  • Java类源码下载

广告也精彩

反馈

请通过下述方式给我们反馈
反馈
提问
网站简介|广告服务|VIP资费标准|银行汇款帐号|网站地图|帮助|联系方式|诚聘英才|English|问题报告
北京创新乐知广告有限公司 版权所有, 京 ICP 证 070598 号
世纪乐知(北京)网络技术有限公司 提供技术支持
Copyright © 2000-2008, CSDN.NET, All Rights Reserved
GongshangLogo