1
votes

Would it be possible to use a navigation-case as shown below with the same view-id but different from-outcomes? In the managed bean, I wanted to compare the from-outcome values and decide on the group panel that I would display on the page. How can I get the from-outcome value in my managed bean?

<navigation-case>
    <from-outcome>modifyphone</from-outcome>
    <to-view-id>/modifytelephone.jsp</to-view-id>
</navigation-case>
<navigation-case>
    <from-outcome>confirmmodifyphone</from-outcome>
    <to-view-id>/modifytelephone.jsp</to-view-id>
</navigation-case>
<navigation-case>
    <from-outcome>submitmodifyphone</from-outcome>
    <to-view-id>/modifytelephone.jsp</to-view-id>
</navigation-case>
1

1 Answers

2
votes

You can't use outcomes for that. Just assign it as a bean property:

public String submit() {
    this.action = MODIFY; // or CONFIRM or SUBMIT
    return "modifyphone";
}

(yes, those are enums)

and then in JSP page:

<h:panelGroup rendered="#{bean.action == 'MODIFY'}"></h:panelGroup>
<h:panelGroup rendered="#{bean.action == 'CONFIRM'}"></h:panelGroup>
<h:panelGroup rendered="#{bean.action == 'SUBMIT'}"></h:panelGroup>