title: How to pass parameter to valueChangeListener in p:dataTable?
body: <p>I am calling <code>valueChangeListener</code> on a <code>&lt;h:selectBooleanCheckbox&gt;</code> which is inside a dataTable. and that dataTable is again inside another(outer) dataTable. In the <code>valueChangeListener</code> method I want the instance object of outer dataTable. Is there any way to get the object of outer dataTable instance?</p>
  
  <p>EX:</p>
  
  <pre><code>&lt;h:panelGroup id="panelId"&gt;
      &lt;p:dataTable id="outerDatatable"
                   var="supplier"
                   value="bean.supplierList"&gt;
  
          &lt;p:column&gt;
              &lt;f:facet name="header"&gt;
                  &lt;h:outputText value="Suppliers" /&gt;
              &lt;/f:facet&gt;
              &lt;h:outputText value="#{supplier.name}" /&gt;
          &lt;/p:column&gt;
  
          &lt;p:column&gt;
              &lt;p:dataTable id="innerDataTable"
                           var="supplierAccount"
                           value="supplier.supplierAccountList"&gt;
  
                  &lt;p:column&gt;
                      &lt;h:selectBooleanCheckbox id="booleanBoxId"
                                               value="#{supplierAccount.supported}"
                                               valueChangeListener="#bean.checkBoxListener}"
                                               immediate="true"
                                               onchange="this.form.submit();"/&gt;
                  &lt;/p:column&gt;
              &lt;/p:dataTable&gt;
          &lt;/p:column&gt;
      &lt;/p:dataTable&gt;
  &lt;/h:panelGroup&gt;
  </code></pre>
  
  <p>I found the following solution : I used <code>&lt;p:ajax&gt;</code> listener instead of <code>valueChangeListener</code>, and I could pass 'supplier' object as well as <code>supplierAccount</code> object to this listener method. We can pass any number of custom objects to <code>&lt;p:ajax&gt;</code> listener. </p>
  
  <pre><code>&lt;p:column&gt;
      &lt;h:selectBooleanCheckbox id="booleanBoxId"
                               value="#{supplierAccount.supported}"
                               immediate="true"&gt;
      &lt;/h:selectBooleanCheckbox&gt;
  
      &lt;p:ajax listener="#{bean.myListenerMethod(supplier,supplierAccount)}"
              update=":formName:panelId"/&gt;
  &lt;/p:column&gt;
  </code></pre>