Primefaces datatable is not populating with the list from backing bean
I have a feedBackSearchList as follows,
List feedBackSearchList;
开发者_StackOverflow中文版I'm trying to set this list to populate in datatable in my xhtml page.
setFeedBackSearchList(getFeedbackSearchService().getSearchResult(
idemployee, idCliente, applicId, idEst, estId, idtecnologia));
I got the list from database, but it is not showing in xhtml page.
Please help me. The xhtml page is as follows,
<p:dataTable id="feedBackResultTab" var="feedBackResult" dynamic="true" value="#{feedbackSearchView.feedBackSearchList}" >
<p:column>
<f:facet name="header">
<h:outputText value="Employee" />
</f:facet>
<f:facet name="output">
<h:outputText value="#{feedBackResult.employeename}" />
</f:facet>
</p:column>
<p:column>
<f:facet name="header">
<h:outputText value="Client" />
</f:facet>
<f:facet name="output">
<h:outputText value="#{feedBackResult.desCliente}" />
</f:facet>
</p:column>
<p:column>
<f:facet name="header">
<h:outputText value="Application" />
</f:facet>
<f:facet name="output">
<h:outputText value="#{feedBackResult.applicationDesc}" />
</f:facet>
</p:column>
<p:column>
<f:facet name="header">
<h:outputText value="Estimation Methode" />
</f:facet>
<f:facet name="output">
<h:outputText value="#{feedBackResult.desMethodEst}" />
</f:facet>
</p:column>
<p:column>
<f:facet name="header">
<h:outputText value="Technology" />
</f:facet>
<f:facet name="output">
<h:outputText value="#{feedBackResult.destecnologia}" />
</f:facet>
</p:column>
<p:column>
<f:facet name="header">
<h:outputText value="Date" />
</f:facet>
<f:facet name="output">
<h:outputText value="#{feedBackResult.fechaultimaactualizacion}" />
</f:facet>
</p:column>
</p:dataTable>
Please help where I have done the mistake.
you access the objects like in an array instead of feedBackResult.desMethodEst
just feedBackResult[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.
UPDATE:
Ok, you should change your columns like this:
<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.
精彩评论