myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "David Brunette" <David.Brune...@chordiant.com>
Subject Checking for navigation rule
Date Fri, 31 Aug 2007 15:25:48 GMT
 

     Hi everybody.

 

     Is there an easy way for an action method to check for the
existence of a navigation rule before returning the outcome String?  I
know that the normal functionality is that, if you return an outcome
that does not match to an existing navigation rule, the same view will
be shown again.  But I'd like to check for that nav rule before
returning from the action method so I can go do something else instead
of just showing the same page again.

 

     I've done something like the following, but this doesn't seem to be
the most efficient since I'd be creating the ViewRoot once in
handleNavigation() and then again when I return the outcome.

 

public String actionMethod() {

   String outcome = "someOutcome";

   UIViewRoot oldView = facesContext.getViewRoot();

 
facesContext.getApplication().getNavigationHandler().handleNavigation(
facesContext, null, outcome );

   if( facesContext.getViewRoot() == oldRoot ) {

      // No nav rule found, do something else...

      outcome = getOutcomeFromElsewhere();

   }

   return outcome;

}

 

     Any alternatives?  Thanks...

 

Dave

The information transmitted herewith is sensitive      information of Chordiant Software or
its customers and is intended only for use to the individual or entity to which it is addressed.
If the reader of this message is not the intended recipient, you are hereby notified that
any review, retransmission, dissemination, distribution, copying or other use of, or taking
of any action in reliance upon, this information is strictly prohibited. If you have received
this communication in error, please contact the sender and delete the material from your computer.

Mime
View raw message