-
1. Re: Keep Trinidad table sort order
pmuir Jan 13, 2008 10:46 AM (in response to brachie)You need to place the EntityQuery in a longer scope to retain the sort criteria it holds (or somehow place the criteria in a longer scope).
-
2. Re: Keep Trinidad table sort order
brachie Jan 14, 2008 11:09 AM (in response to brachie)Hi Pete,
thanks for the answer. I do not fully unterstand how to do what you suggested.
What I am doing is:
Conversational SFSB@DataModel private List<Mitarbeiter> mitarbeiters; ... @Factory(value = "mitarbeiters") public void getMitarbeiterList() { Criteria c = ((HibernateSessionProxy) entityManager.getDelegate()) .createCriteria(Mitarbeiter.class); c.addOrder(Order.desc("nachname")); mitarbeiters = c.list(); }
and in my template:<tr:table width="290px" value="#{mitarbeiters}" var="mitarbeiter" rows="5" styleClass="trTableDiv"> <tr:column sortable="true" sortProperty="login"> <f:facet name="header">Login</f:facet> <s:link value="#{mitarbeiter.login}" propagation="new" action="#{mitarbeiterMgr.selectMitarbeiter}"> <f:param name="mitarbeiterId" value="#{mitarbeiter.id}" /> </s:link> </tr:column> ... </tr:table>
After clicking the link the same page loads again with the details of mitarbeiter, but the sort order of the table is gone.
Ho do I access the EntityQuery or place the Criteria in another scope?
Alexander -
3. Re: Keep Trinidad table sort order
pmuir Jan 14, 2008 12:34 PM (in response to brachie)The code I wrote for backing the Trinidad table with a database query must be backed by an EntityQuery, not some arbitrary @DataModel
-
4. Re: Keep Trinidad table sort order
brachie Jan 14, 2008 1:17 PM (in response to brachie)@Pete:
Oh yes, sorry! I just realized that I need an EntityQuery to make the database backing work. The template then uses the entityQuery.dataModel...
One more question:
In our project we are working with org.hibernate.search.FullTextQuery. Is there any way to translate the FulltextQuery to an EntityQuery so that paging/sorting works database backed for the fulltextSearch-results?
Thanks!
Alexander -
5. Re: Keep Trinidad table sort order
pmuir Jan 14, 2008 5:31 PM (in response to brachie)Not AFAIK.