This content has been marked as final.
Show 3 replies
-
1. Re: Factory annotation on List-returning method
lvdberg Aug 19, 2010 2:41 AM (in response to cdecker)Hi,
can you send the piece of code of the Factory and the rich:dataTable part of show-project.xhtml ?
Leo
-
2. Re: Factory annotation on List-returning method
cdecker Aug 19, 2010 7:23 AM (in response to cdecker)@Factory public List<Extract> getExtracts() { if (extractList == null) { extractList = getEntityManager().createQuery("select extract from Extract extract order by id desc").getResultList(); } return extractList; }
But I'm sure that it works fine, since when debugging it returns exactly what I expected. The extendedDataTable looks like this:
<rich:extendedDataTable id="extractsTable" value="extracts" var="extract" sortMode="single" rows="25" reRender="extractsTableScroller"> <rich:column sortable="true" sortBy="#{extract.id}" filterBy="#{extract.id}" filterEvent="onkeyup" label="ID" width="50px"> <f:facet name="header"> <h:outputText value="ID" /> </f:facet> <h:outputText value="#{extract.id}" /> </rich:column> <rich:column sortable="true" sortBy="#{extract.name}" filterBy="#{extract.name}" filterEvent="onkeyup" label="Name" width="350px"> <f:facet name="header"> <h:outputText value="Name" /> </f:facet> <s:link view="/userlab/show-extract.xhtml" value="#{extract.name}" propagation="none"> <f:param name="extractId" value="#{extract.id}" /> </s:link> </rich:column> </rich:extendedDataTable>
If instead of extracts I use #{manager.getExtract()} for the value attribute in the <rich:extendedDataTable/> it all works like a charm.
Did I miss something?
-
3. Re: Factory annotation on List-returning method
lvdberg Aug 19, 2010 7:44 AM (in response to cdecker)Hi,
The errormessage states a String in extract, and that is exactly what is happening. You're not referencing a bean, but a string value.
You should use the following in you dataTable
value="#{extracts}"
Leo