[jboss-user] [JBoss Seam] - Re: Problem with extra action method executing

raja05 do-not-reply at jboss.com
Wed Sep 6 12:20:14 EDT 2006


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 were

  |        actionsWereCalled = Pages.callAction( event.getFacesContext() ) || actionsWereCalled;
  |          actionsWereCalled = actionsWereCalled || Pages.instance().callAction();
  |          return actionsWereCalled;
  | 
that should fix this.


View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3969794#3969794

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3969794



More information about the jboss-user mailing list