0
<h:dataTable id="merchantDataTable"
        value="#{merchantManagementBean.merchants}" first="0"
        rows="#{merchantManagementBean.rowsPerPage}" var="merchant"
        styleClass="dataTable"
        columnClasses="users-colMerchant, users-colMerchantDescr,  nostyle"
        rowClasses="oddRow, evenRow">
        <h:column>
            <f:facet name="header">
                <h:panelGrid columns="1">
                    <h:selectBooleanCheckbox />
                </h:panelGrid>
            </f:facet>
            <h:selectBooleanCheckbox value="#{merchant.selected}"/>
        </h:column>
</h:datatable>

Yea so I have this code part and I need to make the main checkbox to make them all checked I can use Probably only Javascript based solution since communication with bean is going to server side.

1 Answers1

0

Please have a look at the following posts:

How to create effective "select all" checkbox in JSF

how to create selectAll checkbox in JSF-2

Or you can approach this problem witj jQuery to select all checkboxes:

http://www.sanwebe.com/2014/01/how-to-select-all-deselect-checkboxes-jquery

Community
  • 1
  • 1
daan.desmedt
  • 3,752
  • 1
  • 19
  • 33
  • Your answer would be better explaining the process here or closing the question as a duplicate (which it clearly is), that has been previously answered – kolossus Sep 16 '14 at 06:14