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. > >In the future, the menu will be dynamic, > > making this approach impossible to use. Futhermore I've got several JSF > > pages, all using the same menu, but with different actions. How do I make > > struts-faces forward the control from the JSF page back to the action > > that has this page as its 'input'? > > I'm not familiar with the 'x:commandNavigation' component but if the > navigation is not thru a javascript (form post), I think you would make > your links to struts actions (xyz.do). I'm not sure how you would handle > it with components that used javascript posts and not part of the > struts-faces integration library because it would assume that you would be > dispatched thru the faces servlet and the lifecycle on the component tree > invoked. You might try a global navigation rule in the faces-confg but I > doubt that would work. > > <navigation-rule> > <from-view-id>*</from-view-id> > <navigation-case> > <from-outcome>next</from-outcome> > <to-view-id>/xyz.do</to-view-id> > </navigation-case> > </navigation-rule> I'm trying to not make any difference between different implementations of actions (either form submits or links, javascript or not). Configuration the action to transfer to in a navigation rule like you did is not possible, because I've got several actions with JSF pages for the input. All actions on 'a.faces' need to transfer control to 'a.do', actions on 'b.faces' to 'b.do' etc. The control path will always be: <name>.do -> <name>.faces -> <name>.do. I'm trying to leave the JSF navigation out of this, because it will make things a lot less transparent. For submits of a form, it is easy. The action to submit to is in the 'action' attribute of the form. However for links and pages without a form things are more complicated. Basically I'm looking for a way to transfer control to the request processor after evaluation of the action binding. I am thinking of implementing my own NavigationHandler that starts the request processor instead of using faces-config, but maybe I'm missing something? Emond Papegaaij --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]