???關於STRUTS MULTIBOX怎麼使用?有誰知道嗎?幫幫忙啦
急急急~~~~~搞了幾天沒搞出來,大家知道的教教我,謝謝 问题点数: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




