Thanks Mike,

So what i understand is that if only <from-action> is given, then
irrespective of the outcome the control will go to the view id specified.
For instance the folllowing rule is define din the faces config file:
<navigation-rule>
  <from-view-id>/bingo.jsp</from-view-id>
  <navigation-case>
    <from-action>#{sombean.someAction}</from-action>
    <to-view-id>/tringo.jsp</to-view-id>
  </navigation-case>
</navigation-rule>

Does the above rule mean that if someAction method is executed then
irrespective of the outcome the control will always go to tringo.jsp? If my
interpretation is correct then can you think of any place where this might
be used?

Now consider a second example:

<navigation-rule>
  <from-view-id>/bingo.jsp</from-view-id>
  <navigation-case>
    <from-action>#{sombean.someAction}</from-action>
    <from-outcome>success</from-outcome>
    <to-view-id>/tringo.jsp</to-view-id>
  </navigation-case>
</navigation-rule>

Does it mean that only if the output after executing someAction is success
only then the control will go to tringo.jsp?
If that is the case then why not just give the <from-outcome>, why is the
combination of both the tags is required?

Consider a third case:
<navigation-rule>
  <from-view-id>/bingo.jsp</from-view-id>
  <navigation-case>
    <from-action>#{sombean.someAction}</from-action>
    <to-view-id>/tringo.jsp</to-view-id>
  </navigation-case>
  <navigation-case>
    <from-outcome>success</from-action>
    <to-view-id>/tringo123.jsp</to-view-id>
  </navigation-case>
</navigation-rule>

Now if someAction method is executed and the outcome is success then where
will the control go? Will it go to tringo.jsp as defined by the first
navigation-case or will it go to tringo123.jsp as defined in the second
navigation case as both the cases are satisfied?

~madhav

On 3/3/07, Mike Kienenberger <[EMAIL PROTECTED]> wrote:

See this thread:

http://www.mail-archive.com/[email protected]/msg34510.html

and this document

http://java.sun.com/j2ee/1.4/docs/tutorial/doc/JSFConfigure7.html


On 3/3/07, Madhav Bhargava <[EMAIL PROTECTED] > wrote:
>
> Thanks Volker,
>
> I figured that out, but still i cannot understand the usage of
> <from-action>.
> I needed the above information because i needed to call an action method
> and then transfer the control the navigation handler programmatically. I was
> able to achieve the same by first creating a MethodBinding, invoking it,
> getting the return value as an outcome and passing the same to the
> handleNavigation method of the NavigationHandler.
>
> It worked for me.
> ~madhav
>
> On 3/3/07, Volker Weber < [EMAIL PROTECTED]> wrote:
> >
> > Hi Madhav,
> >
> > the action methodBinding is handled in the defaultActionListener,
> > which is invoked also in
> > broadcast() from UICommand.
> >
> > NavigationHandler.handleNavigation() is done in processAction of
> > defaultActionListener:
> > 
http://svn.apache.org/viewvc/myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/application/ActionListenerImpl.java?view=markup
> >
> >
> > Regards,
> >   Volker
> >
> >
> >
> >
> >
> > 2007/3/2, Madhav Bhargava < [EMAIL PROTECTED] >:
> > >
> > >  Hi All,
> > >
> > >
> > >
> > > HtmlCommandLink and HtmlCommandButton extend UICommand component
> > > class.
> > >
> > > UICommand creates 2 MethodBindings – action and actionListener.
> > >
> > >
> > >
> > > I was looking at the code for UICommand class and I could locate
> > > where the registered actionListeners were getting executed – *
> > > broadcast* method but I was not able to figure out where the action
> > > method was getting invoked and how does NavigationHandler takes control 
from
> > > there on.
> > >
> > >
> > >
> > > In NavigationHandler javadoc the following is mentioned:
> > >
> > > public abstract void *handleNavigation*(javax.faces.context.FacesContext 
context,
> > >
> > >                                       java.lang.String fromAction,
> > >
> > >
> > >
> > >
> > >
> > >                                       java.lang.String outcome)
> > >
> > >
> > >
> > > *Parameters:*
> > >
> > > context - The 
FacesContext<http://java.sun.com/javaee/javaserverfaces/1.1/docs/api/javax/faces/context/FacesContext.html>for
 the current request
> > >
> > > fromAction - The action binding expression that was evaluated to
> > > retrieve the specified outcome, or null if the outcome was acquired
> > > by some other means
> > >
> > > outcome - The logical outcome returned by a previous invoked
> > > application action (which may be null)
> > >
> > >
> > >
> > > Does it mean that if I create a MethodBinding out of an action EL
> > > expression and then invoke the same, then will it execute the action 
method
> > > and then automatically call the method specified above to navigate to next
> > > view according to the navigation rules defined?
> > >
> > >
> > >
> > > Any insight into this will be helpful.
> > >
> > >
> > >
> > > Regards,
> > >
> > > Madhav
> > >  **************** CAUTION - Disclaimer *****************
> > > This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION
> > > intended solely for the use of the addressee(s). If you are not the 
intended
> > > recipient, please notify the sender by e-mail and delete the original
> > > message. Further, you are not to copy, disclose, or distribute this e-mail
> > > or its contents to any other person and any such actions are unlawful. 
This
> > > e-mail may contain viruses. Infosys has taken every reasonable precaution 
to
> > > minimize this risk, but is not liable for any damage you may sustain as a
> > > result of any virus in this e-mail. You should carry out your own virus
> > > checks before opening the e-mail or attachment. Infosys reserves the right
> > > to monitor and review the content of all messages sent to or from this
> > > e-mail address. Messages sent to or from this e-mail address may be stored
> > > on the Infosys e-mail system.
> > > ***INFOSYS******** End of Disclaimer ********INFOSYS***
> > >
> >
> >
>
>
> --
> When I tell the truth, it is not for the sake of convincing those who do
> not know it, but for the sake of defending those that do





--
When I tell the truth, it is not for the sake of convincing those who do not
know it, but for the sake of defending those that do

Reply via email to