-
1. Re: begginer question - request parameters
delphi'sghost Sep 5, 2007 10:34 PM (in response to przadka)I'm no expert on Seam-Gen generated edit pages, but I think it goes like this :
The edit pages edits a Widget called "widget", it doesn't matter if it is a new one, or an existing one.
You create a factory method for "widget" which in the same bean, injects the parameter widgetId. The factory method says "If I have an ID, load the widget, otherwise create a new one". Either way, it outjects a Widget called "widget", new or loaded.
So, you load the edit page, which requests a bean called "widget" so seam calls the factory method on the bean, injecting the parameters beforehand. Your factory method checks the parameter, loads or creates a new widget, and returns it to Seam, which passes it to the page for editing. -
2. Re: begginer question - request parameters
przadka Sep 6, 2007 12:47 PM (in response to przadka)thanks for the answer. i did some experiments which seem to confirm it.
the source of my question is in the paging example in the documentation:
http://docs.jboss.com/seam/1.2.1.GA/reference/en/html/framework.html#d0e5897
in the example, the paging parameter (firstResult) is passed as a request parameter which is used by the entityquery component to display proper result set.
i tried to follow the documentation but i ended up displaying the same result no matter what i pass as the request parameter. im not sure what i did wrong because the request parameter is never assigned explicitly (at least in the documentation example).
and my question: is there a bug in the documentation (i dont think so) or the firstResult request parameter does not have to be assigned explicitly to the EntityQuery component? if it does not, how to tell seam it should pass it to the entity query from the request parameter?
best regards,
michal -
3. Re: begginer question - request parameters
przadka Sep 6, 2007 6:06 PM (in response to przadka)solved.
what i was looking for was the @RequestParameter annotation.
best regards
michal -
4. Re: begginer question - request parameters
pmuir Sep 7, 2007 5:37 AM (in response to przadka)"przadka" wrote:
and my question: is there a bug in the documentation (i dont think so) or the firstResult request parameter does not have to be assigned explicitly to the EntityQuery component? if it does not, how to tell seam it should pass it to the entity query from the request parameter?
This is what the page parameter is for.