在icefaces中选择BooleanCheckbox
<ice:column style="width: 30px;">
<f:facet name="header">
<ice:selectBooleanCheckbox
value="#{createToolsOrderInwardsBean.test}"
partialSubmit="true"
valueChangeListener="#{createToolsOrderInwardsBean.selectInwardQuantityChk}"
id="slc-tlmanage-selectallee"></ice:selectBooleanCheckbox>
</f:facet>
<ice:selectBooleanCheckbox value="#{currentRow.chkInwardQuantity}"
immediate="true" partialSubmit="true" style="margin-left: 10px;"
id="slc-tlmanage-enableinput"></ice:selectBooleanCheckbox>
</ice:column>
我在 ocefaces 数据表中有这段代码。当我选择第一个复选框而不是所有其他复选框时,将选择该数据表列。
下面我描述了一种
public void selectInwardQuantityChk(ValueChangeEvent evt){
if(evt != null){
Boolean value =(Boolean)evt.getNewValue();
if(test)
for(int i=0;i<this.toolsOrderVO.getToolsOrderItemVOList().size();i++){
this.toolsOrderVO.getToolsOrderItemVOList().get(i).setChkInwardQuantity(value);
System.out.println("int the for loop for changing value ============>"+this.toolsOrderVO.getToolsOrderItemVOList().get(i).getChkInwardQuantity());
}
}
}
名为 valuechage 的方法,甚至复选框值也不能改变。
<ice:column style="width: 30px;">
<f:facet name="header">
<ice:selectBooleanCheckbox
value="#{createToolsOrderInwardsBean.test}"
partialSubmit="true"
valueChangeListener="#{createToolsOrderInwardsBean.selectInwardQuantityChk}"
id="slc-tlmanage-selectallee"></ice:selectBooleanCheckbox>
</f:facet>
<ice:selectBooleanCheckbox value="#{currentRow.chkInwardQuantity}"
immediate="true" partialSubmit="true" style="margin-left: 10px;"
id="slc-tlmanage-enableinput"></ice:selectBooleanCheckbox>
</ice:column>
I have this code whtin ocefaces datatable.When i select first one than all other checkbox whin that column of datatable will be selected.
below i described a valuchage method
public void selectInwardQuantityChk(ValueChangeEvent evt){
if(evt != null){
Boolean value =(Boolean)evt.getNewValue();
if(test)
for(int i=0;i<this.toolsOrderVO.getToolsOrderItemVOList().size();i++){
this.toolsOrderVO.getToolsOrderItemVOList().get(i).setChkInwardQuantity(value);
System.out.println("int the for loop for changing value ============>"+this.toolsOrderVO.getToolsOrderItemVOList().get(i).getChkInwardQuantity());
}
}
}
method called and even checkbox value can't change.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您的问题中有相当多的拼写错误,所以我对您的问题的理解可能不完整。如果我正确理解你的问题,那么它可以很容易地解决。
将此行添加到您的事件处理程序中。(在方法的开头)
There were considerable typos in your question, So my understanding of your problem could be patchy. If I understand your problem correctly, then it can be solved easily.
Add this line to your event handler.(At the start of the method)