-
1. Re: Problem with extra action method executing
sjmenden Sep 6, 2006 8:14 AM (in response to texan)Just to let you know, you are not alone. I am not sure if there is some special attribute to the pages.xml xml, however, I ran into the exact same problem. Lessoned learned, don't use pages.xml with a Stateful bean that uses pagination, it won't work. I had to change the way I was doing things because I believe what you described above is intended by the pages.xml action. You define pages there so that the corresponding action gets executed EVERY time the page is loaded without exception.
If this breaks your application, then you shouldn't use pages.xml, but look at the @Factory method possibly. Or the pull-style section of the seam documentation. -
2. Re: Problem with extra action method executing
texan Sep 6, 2006 10:19 AM (in response to texan)My particular problem is that the "from" page action is getting executed when I leave the page. Very frustrating.
-
3. Re: Problem with extra action method executing
raja05 Sep 6, 2006 12:20 PM (in response to texan)This seems to be happening in AbstractPhaseListener and looks like a bug. The code in question is
public boolean callPageActions(PhaseEvent event) { Lifecycle.setPhaseId( PhaseId.INVOKE_APPLICATION ); boolean actionsWereCalled = false; try { actionsWereCalled = Pages.callAction( event.getFacesContext() ) || actionsWereCalled; actionsWereCalled = Pages.instance().callAction() || actionsWereCalled; return actionsWereCalled;
The first "Pages.callAction(event.getFacesContext()) || actionsWereCalled " runs the intended action i.e. the action in the second page. Note that at this point, the view-id is still the first page as the lifecycle has not come into the "render" phase -- still in the "Execute" phase. Now that the method returned true, we are again invoking the Pages.instance().callAction() which calls the first view since the view-id is the first page. Thats the reason for the out of order of messages.
If the code wereactionsWereCalled = Pages.callAction( event.getFacesContext() ) || actionsWereCalled; actionsWereCalled = actionsWereCalled || Pages.instance().callAction(); return actionsWereCalled;
that should fix this. -
4. Re: Problem with extra action method executing
texan Sep 6, 2006 12:38 PM (in response to texan)Thanks for tracking down the source of the problem! I've been juggling too many projects to dare digging into the Seam code.
I'll have to look into submitting this via JIRA. -
5. Re: Problem with extra action method executing
gavin.king Sep 6, 2006 10:27 PM (in response to texan)Please submit this to JIRA and I will take a look.
-
7. Re: Problem with extra action method executing
gavin.king Sep 18, 2006 7:37 PM (in response to texan)I reviewed this and I can't confirm your conclusions. Make sure you have testes against current CVS. If it still doesn't work, I need a test case.