title: Enable/Disable <p:commandButton> in footer of <p:dataTable> based on change of <p:column selection="multiple">
body: <p>I have a datatable where I am showing List of Employees. At the end of the datatable I have a commandbutton. Now if user selects any checkbox inside the datatable, I want my commandbutton to be enabled. Initially the command button is disabled. </p>
  
  <p>Below is my index.xhtml page</p>
  
  <pre><code>&lt;p:dataTable value="#{userPreferencesBean.studentDataModel}"
                  var="studentDetails" emptyMessage="No Student found."
                  selection="#{userPreferencesBean.selectedStudents}"&gt;
                  &lt;f:facet name="header"&gt;
                      List of Students
                  &lt;/f:facet&gt;
  
                  &lt;p:ajax event="rowSelect" update="submit" listener="#{userPreferencesBean.onRowSelect}"/&gt;
                  &lt;p:ajax event="rowUnselect" update="submit" listener="#{userPreferencesBean.onRowSelect}"/&gt;
  
                  &lt;p:column selectionMode="multiple" style="width:2%" /&gt;
  
                  //All the columns 
  
                  &lt;f:facet name="footer"&gt;
                      &lt;p:commandButton id="submit" value="Save Preferences"
                          icon="ui-icon-disk" style="float:right;"
                          action="#{userPreferencesBean.savePreferredInterfaces}"
                          update=":#{p:component('selectedInterfaceDetails')}" 
                          disabled="#{not userPreferencesBean.hasPreferenceChanged eq false}"/&gt;
                  &lt;/f:facet&gt;
              &lt;/p:dataTable&gt;
  </code></pre>
  
  <p>Below is my backing bean:</p>
  
  <pre><code>@ManagedBean
  @SessionScoped
  public class UserPreferencesBean implements Serializable {
  
      private boolean hasPreferenceChanged = false;
  
      public void onRowSelect(SelectEvent event) {
          this.setHasPreferenceChanged(true);
      }
  
      public boolean isHasPreferenceChanged() {
          return hasPreferenceChanged;
      }
  
      public void setHasPreferenceChanged(boolean hasPreferenceChanged) {
          this.hasPreferenceChanged = hasPreferenceChanged;
      }
  </code></pre>
  
  <p>What I am expecting is that once I select a row, my submit button should be enabled. But it is not happening. Could you please help me to understand where I am doing wrong? Thanks.</p>
  
  <p>With regards,
  Sudipta Deb</p>