Rectangle 27 0

You should not populate the list in the setter method. JSF will call the getter-method of your list if it builds the datatable. So you should either populate the list in the getFeedBackSearchList or (and even better): in a method populateFeedbackSearchList at bean construction time.

<p:column>
  <f:facet name="header">
    <h:outputText value="Employee" />
  </f:facet>
  <h:outputText value="#{feedBackResult.employeename}" />
</p:column>

No facet is needed for the cell content, only for the header.

Yes, you said right. But, in this scenario, I have form with select boxes, based on selection I have to query the database, a list will be returned and I need to populate the datatable with the returned list. Here I get list of type List<Object []> . How can I populate this list to the datatable.

@Narasimha Make sure that the set-method is called before you build the table. Add a breakpoint inside the get-method of your list and check if the list contains data at the time the datatable is built.

Thanks Matt. I have done as you suggested.But List is not empty. the datatable is not able to show the data inside the list.I don't have a corresponding Model class for this backing bean. It will contact serveral model classes for property mapping. How can I access List<Object[]> in datatable.

Thanks for your response Matt. I removed facets for outputtext. But the result is same. Is there any work around for this problem.

jsf - Primefaces datatable is not populating with the list from backin...

jsf primefaces
Rectangle 27 0

You should not populate the list in the setter method. JSF will call the getter-method of your list if it builds the datatable. So you should either populate the list in the getFeedBackSearchList or (and even better): in a method populateFeedbackSearchList at bean construction time.

<p:column>
  <f:facet name="header">
    <h:outputText value="Employee" />
  </f:facet>
  <h:outputText value="#{feedBackResult.employeename}" />
</p:column>

No facet is needed for the cell content, only for the header.

Yes, you said right. But, in this scenario, I have form with select boxes, based on selection I have to query the database, a list will be returned and I need to populate the datatable with the returned list. Here I get list of type List<Object []> . How can I populate this list to the datatable.

@Narasimha Make sure that the set-method is called before you build the table. Add a breakpoint inside the get-method of your list and check if the list contains data at the time the datatable is built.

Thanks Matt. I have done as you suggested.But List is not empty. the datatable is not able to show the data inside the list.I don't have a corresponding Model class for this backing bean. It will contact serveral model classes for property mapping. How can I access List<Object[]> in datatable.

Thanks for your response Matt. I removed facets for outputtext. But the result is same. Is there any work around for this problem.

jsf - Primefaces datatable is not populating with the list from backin...

jsf primefaces