On 6/6/05, Emond Papegaaij <[EMAIL PROTECTED]> wrote:
> On Monday 06 June 2005 18:06, [EMAIL PROTECTED] wrote:
> > > Currently I'm using a construction similar to the one used in the
> > > struts-faces examples. A backing bean contains the forwards and these are
> > > called from the JSF with the following code:
> > > 'action="#{backing.forward}"'. However this solution is not very
> > > flexible, as the backing bean needs to have a forward method for every
> > > forward used.
> >
> > I believe that you can use a string instead of a binding expression, like
> > you would a action forward (action='next')
> 
> This is indeed possible, but EL makes no distinction between a constant and an
> expression. To get the constant, the expression needs to be evaluated. It is
> possible to evaluate this constant in a custom ActionListener, but that would
> mean the expression is evaluated twice.
> 

Don't use an expression:

   <h:commandButton ... action="#{next}"/>

instead, use a literal String:


    <h:commandButton ... action="next"/>

The JSF runtime recognizes this scenario, and uses "next" as the
logical outcome value to be fed in to the navigation rules, without
calling an application action.  That means the only thing you need to
do is define navigation rules that determine where to go next -- and
with those, you can make "next" mean something different depending on
which page you're currently on.

Craig

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to