[jboss-user] [JBoss Seam] - Re: Seam 2, pages.xml and pageflow

rlhr do-not-reply at jboss.com
Fri Jul 27 00:27:01 EDT 2007


I still don't understand why it is not working, but here is what I found out.

After the transition (false), we go to the page /flow/itemSelection.xhtml

That page is defined on pages.xml as:


  | <page view-id="/flow/itemSelection.xhtml" action="#{flow.itemSelectionOutcome}" />
  | 

The action is triggered and the outcome of this action is "listA"

I end up in the  "navigate" method of Pages.java which is defined as:


  |    public boolean navigate(FacesContext context, String actionExpression, String actionOutcomeValue)
  |    {
  |       String viewId = getViewId(context);
  |       if (viewId!=null)
  |       {
  |          List<Page> stack = getPageStack(viewId);
  |          for (int i=stack.size()-1; i>=0; i--)
  |          {
  |             Page page = stack.get(i);
  |             Navigation navigation = page.getNavigations().get(actionExpression);
  |             if (navigation==null)
  |             {
  |                navigation = page.getDefaultNavigation();
  |             }
  |             
  |             if ( navigation!=null && navigation.navigate(context, actionOutcomeValue) ) return true;  
  |             
  |          }
  |       }
  |       return false;
  |    }
  | 

The parameters are:


  | actionExpression: #{flow.itemSelectionOutcome}
  | actionOutcomeValue: "listA"
  | 

So far so good, I believe.

String viewId = getViewId(context) returns "/flow/itemSelection.xhtml" which is correct as well.

Nevertheless, when the following is performed:


  | Navigation navigation = page.getNavigations().get(actionExpression);
  | 

navigation is null! No navigation rule is found, so the defaultNavigation is selected and is null as well.

So I don't understand why is that.

So instead of 


  | <page view-id="/flow/itemSelection.xhtml" action="#{flow.itemSelectionOutcome}" />
  | 
  | <page view-id="/flow/*">
  |         <navigation>
  |             <rule if-outcome="listA">
  |                 <redirect view-id="/flow/A/itemSelection.xhtml"/>
  |             </rule>
  |             <rule if-outcome="listB">
  |                 <redirect view-id="/flow/B/itemSelection.xhtml"/>
  |             </rule>
  |         </navigation>
  | </page>
  | 

I changed to:


  | <page view-id="/flow/itemSelection.xhtml" action="#{flow.itemSelectionOutcome}">
  |         <navigation>
  |             <rule if-outcome="listA">
  |                 <redirect view-id="/flow/A/itemSelection.xhtml"/>
  |             </rule>
  |             <rule if-outcome="listB">
  |                 <redirect view-id="/flow/B/itemSelection.xhtml"/>
  |             </rule>
  |         </navigation>
  | </page>
  | 

But this leads to the same problem.

Is there anything wrong in the what I'm doing? I believe this should work.

Richard

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

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



More information about the jboss-user mailing list