我有一个按钮,我想用它来选择我的数据表中的所有复选框。
杰夫:
<webuijsf:button actionExpression="#{user$recentreports.selectAllButton_action}" text="#{msg.report_select_all}"/>
<webuijsf:checkbox binding="#{user$recentreports.selectCB}" valueChangeListenerExpression="#{user$recentreports.selectSingleCBEvent}" id="selectCB" toolTip="#{msg.report_select}"/>
爪哇:
public void selectAllButton_action(){
System.out.println("select all button is clicked");// OK
System.out.println("selectCB.getValue()" + selectCB.getValue()); //outputs: selectCB.getValue()null
selectCB.setSelected(Boolean.TRUE);
System.out.println("selectCB.getValue()" + selectCB.getValue()); //outputs: selectCB.getValue()true|
}
selectSingleCBEvent 正在收集此复选框的行号以在之后删除它们。我想选中所有复选框并删除相应的报告。当我单击按钮时,selectedCB 的 selected 属性变为 true,但在我的表单中我看不到更改。我尝试添加
FacesContext.getCurrentInstance( ).renderResponse( );
但仍然无法正常工作。有人对这个案子有意见吗?提前致谢。