首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > JAVA > Java Web开发 >

关于jsf中selectManyCheckbox的有关问题,多谢大家了

2011-12-23 
关于jsf中selectManyCheckbox的问题,谢谢大家了。在页面中有:h:selectManyCheckbox value#{auser.quanx}

关于jsf中selectManyCheckbox的问题,谢谢大家了。
在页面中有:
<h:selectManyCheckbox value="#{auser.quanx}" styleClass="bartext">
 <f:selectItems value="#{auser.qxItems}"/>
 </h:selectManyCheckbox>

在mybean中有:
private static String[] quanx=new String[3];
private static SelectItem[] qxItems = new SelectItem[]{

new SelectItem("用户设置"),

new SelectItem("栏目设置"),

new SelectItem("信息上传"),

};
问题是:怎样读取选择后的值? 我在代码中通过quanx[0],读取时总失败。

[解决办法]
在线等待,谢谢大家了
[解决办法]
改成這樣試一下
硬編碼的方式

Java code
  <h:selectManyCheckbox   value="#{auser.quanx}"   styleClass="bartext">    <f:selectItem itemLabel="用户设置" itemValue="1"/>    <f:selectItem itemLabel="栏目设置" itemValue="2"/>    <f:selectItem itemLabel="信息上传" itemValue="3"/>   </h:selectManyCheckbox>
[解决办法]
好像还应该加一句private static String quanx="1"; 设个默认值

热点排行