0
votes

I have a button which I want to use for selecting all checkboxes in my datatable.

Jsf:

<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}"/>

java:

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 is collecting the row numbers of this checkbox to delete them afterwards. I want to select all checkboxes and delete the corresponding reports. When I click on the button, selectedCB's selected attribute turns to true, but in my form I can not see the change. I tried adding

FacesContext.getCurrentInstance( ).renderResponse( );

but still not working. Does anyone have any opinion about this case? Thanks in advance.

Have you rerender the datatable after button action ?kinkajou
when the button is clicked request goes and feedback is received, so the page is rendered again. Do I still need rerendering of the datatable?lamostreta