Yes, the highlighted phrase is what confused me as well.
But I think it's just poorly written -- I think that from-action only gives
you the EL expression used to get to this navigation case -- the execution
of the action already took place by this point, so how could it make sense
to execute it again?
Ie, if you have #{bean.editObject} and #{bean.addObject}, you could still
use a single logical "SUCCESS" outcome for both, but distinguish between how
you got the SUCCESS outcome. Using different logical outcome seems more
intuitive.
On 2/28/07, Madhav Bhargava <[EMAIL PROTECTED]> wrote:
Sending it again. For some reason the mail never got delivered.
_____________________________________________
***From:* Madhav Bhargava
***Sent:* Wednesday, February 28, 2007 11:29 AM
***To:* 'MyFaces Discussion'
***Subject:* RE: t:datatable with commandLink and parameter
Hi Craig,
According to the tutorial at the link: *
http://java.sun.com/j2ee/1.4/docs/tutorial/doc/JSFConfigure7.html*<http://java.sun.com/j2ee/1.4/docs/tutorial/doc/JSFConfigure7.html>
"The navigation criteria are defined by optional from-outcome and
from-action elements. The from-outcome element defines a logical outcome,
such as success. The from-action element uses a method-binding expression to
refer to an action method that returns a String, which is the logical
outcome.* The method performs some logic to determine the outcome and
returns the outcome.*"
Does it mean that <from-action> will not execute the action method but
only derive the outcome of the action method?
If yes then what happens when the return String value is a result of the
computation that goes inside the action method?
And if it executes the action method then what is the difference from
using <from-outcome> as it is finally going to go to the outcome produced by
the action method.
Could you please throw some more light on <from-action> usage?
Rgds,
Madhav
> -----Original Message-----
> From: [EMAIL PROTECTED] <[EMAIL PROTECTED]> *
[mailto:[EMAIL PROTECTED] <%5Bmailto:[EMAIL PROTECTED]> On Behalf
Of Craig
> McClanahan
> Sent: Wednesday, February 28, 2007 7:24 AM
> To: MyFaces Discussion
> Subject: Re: t:datatable with commandLink and parameter
>
> On 2/27/07, Mike Kienenberger <[EMAIL PROTECTED] <[EMAIL PROTECTED]>>
wrote:
> > Simon,
> >
> > I don't have any JSF books handy. What's the difference between
> > from-action and from-outcome? I thought outcome was the string
> > returned from an action method?
>
> You can use either or both.
>
> * <from-action> describes the EL expression that triggered
> calling your action. This is useful if you have multiple buttons
> on the form, bound to different actions. (It's also legal to
> have more than one command component bound to the same
> action method ... for example, a "next page" or "previous page"
> link at both the top and bottom of a long page.
>
> * <from-outcome> describes the logical outcome returned by
> whatever action was invoked. This is useful if you want to
> go different places depending on what happened inside an action.
>
> If you use just <from-action>, your navigation rule is triggered
> whenever that action is executed, no matter what outcome was returned.
> If you use just <from-outcome>, your navigation rule is triggered
> when that outcome is returned by any action that was processed. Or,
> you can use them together to define more precisely when this
> navigation should be triggered.
>
> Craig
>
>
> >
> > On 2/27/07, Simon Kitching <[EMAIL PROTECTED]<[EMAIL PROTECTED]>>
wrote:
> > > Mike Kienenberger wrote:
> > > > By the way,
> > > >
> > > > I don't think this is legal:
> > > >
> > > > <from-action>#{ userBackingBean.prepareForEdit}</from-action>
> > > >
> > > > If it is legal, I doubt that's the correct syntax.
> > >
> > > Yep. The from-action value is meant to match the string *returned*
> from
> > > an action method. It is not an EL expression.
> > >
> > > I suggest you find a good JSF book and read the section on
navigation.
> > >
> > > Regards,
> > >
> > > Simon
> > >
> >
**************** 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***