> Hello, > > I'm looking for a elegant way of transfering control from a JSF page back to > an action. The situation is as follows: > An action has its 'input' set to the JSF page and forwards control to > 'getInputForward'. The JSF page contains several input fields and a > navigation panel, using 'x:commandNavigation' (taking directly from the > MyFaces examples). The page also has a normal submit button. When a user > presses one of the navigation links or the submit button, control should be > transfered back to the action. This action contains the logic to decide where > to continue. > > 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') >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> Gary > > Best regards, > Emond Papegaaij > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]