Hello, I'm quite new to JSF and Seam. I've followed docs and using seam-gen
I've managed to generate entities and frontend for them. Now I have class LogsList
that extends EntityQuery. It works fine, however I would like provide user with
possibility to change the results per page.
Generated class has method getMaxResults() and hard coded 25 in it. It seems that
EntityQuery is stateless? After changing set/get methods for maxResults I do not know how
to provide initial value (there are 1M+ entries in DB). I can't do that as there is
@Create annotated method validate and this one is used every time I refresh results. When
I Override the method it seems that
| if(getMaxResults() == null) {setMaxResults(25)}
|
condition always pass. In the LogsList.xhtml (section tableControl) I've provided:
| <h:selectOneMenu value="#{logsList.maxResults}"
id="maxResults">
| <f:selectItem itemLabel="5" itemValue="5"/>
| <f:selectItem itemLabel="10" itemValue="10"/>
| <f:selectItem itemLabel="20" itemValue="20"/>
| </h:selectOneMenu>
|
And I though that when I click next page, the currently selected valued is assigned to
logsList and then proper number of records should be displayed. What am I missing? Or
shall I uses statefull object like "settings" to store such an information?
I've managed to achieve this using Statefull EJB, but I'would love to use this
EntityQuery object. I've digged through the source code of examples (great way of
inspiration) but they either use Statefull EJB or functionality is not provided. I would
also like to restrict search with some restrictions.
Can anybody give me any hints? I might be confused of when to use @In and when/how use
setters of property.
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3992792#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...