SEAM navigation based on a function with parameters

How do you set up a function-based navigation rule with parameters in SEAM?

for instance

<page view-id="/firstPage.xhtml" back="enabled">
    <navigation from-action="#{actionBean.fetchItem(int index)}">
        <redirect view-id="/itemDetail.xhtml" />
    </navigation>
</page>

      

+2


a source to share


2 answers


Maybe,

But ... the action signature must match your commandButton attribute, commandLink, etc.

Suppose your command is shown as follows

<h:commandButton action="#{actionBean.fetchItem(index)}" value="Submit index"/>

      



...

Now your navigation

<page view-id="/firstPage.xhtml" back="enabled">
    <navigation from-action="#{actionBean.fetchItem(index)}">
        <redirect view-id="/itemDetail.xhtml" />
    </navigation>
</page>

      

+3


a source


I don't understand why you need a parameter when you have one result for all parameters.

If that's really what you want - well then don't use any parameters.



If you want to take an action and then return to the view - well, you can return the appropriate one String

from your action method.

0


a source







All Articles