title: How to get columns list from datatable var object in primefaces?
body: <p>I have a datatable like this:</p>
  
  <pre><code>&lt;p:dataTable id="datatableid" value="#{manageBean.employeeList}" var="employeeObj" &gt;
                          &lt;p:column  style="width:10%;font-weight:bold"&gt;
                              &lt;h:outputText value="#{employeeObj.firstName}-#{employeeObj.orgEmployeeId}"/&gt;
                          &lt;/p:column&gt;
  
                          &lt;p:columns value="#{manageBean.fetchDataList(employeeObj)}"  var="dataObj"&gt;
                              &lt;h:outputText value="#{dataObj.status}"/&gt;
                          &lt;/p:columns&gt;
  
                      &lt;/p:dataTable&gt;
  </code></pre>
  
  <p>My bean is:</p>
  
  <pre><code>public List&lt;Attendance&gt; fetchDataList(Employee empObj)
          {
              System.out.println("**** Inside fectch attendance data **** "+empObj.getName());
              List&lt;Attendance&gt; attendanceList = new ArrayList&lt;Attendance&gt;();
              return attendanceList;
          }
  </code></pre>
  
  <p>While running, in syso i am getting null pointer exception because empObj is giving null.</p>
  
  <p>How can i get exact value of empObj object?</p>
  
  <p>What is the correct way to pass datatable variable(var) as argument into fetchDataList method which i have used as value in columns?</p>