[jboss-user] [JBoss Seam] - Conditional navigation in pages.xml

gmarcus do-not-reply at jboss.com
Fri May 11 02:50:55 EDT 2007


I am trying to use navigation in pages.xml.


  | 	<page view-id="/emailvalidate.xhtml" action="#{account.validateEmail}">
  | 		<param name="tk" value="#{token.hash}"/>
  |         <navigation from-action="#{account.validateEmail}">
  |             <rule if-outcome="success">
  |                 <render view-id="/login.xhtml"/>
  |             </rule>
  |         </navigation>
  | 	</page>
  | 

if the action returns "success", seam renders /login.xhtml

This is what I expected.

What I would like to do, is if the outcome is null, render /validate.xhtml

I tried this:


  | 	<page view-id="/emailvalidate.xhtml" action="#{account.validateEmail}">
  | 		<param name="tk" value="#{token.hash}"/>
  | 		<param name="src" value="email"/>
  |         <navigation from-action="#{account.validateEmail}">
  |             <rule if-outcome="success">
  |                 <render view-id="/login.xhtml"/>
  |             </rule>
  |             <rule>
  | 	          <render view-id="/validate.xhtml"/>
  | 	    </rule>
  |         </navigation>
  | 	</page>
  | 

For any outcome other than "success", I expected /validate.xhtml to be rendered, but instead, seam renders the original view-id which is /emailvalidate.xhtml

How can I render one page for a specific outcome from an action, and a different page for any other outcome including null?

Glenn

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

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



More information about the jboss-user mailing list