0

I followed the first example in Trinidad's navigation Dev Guide but the result link always comes out as a "#". I double check their downloadable example but don't see any difference.

Main.xhtml

<tr:page>
    <f:facet name="menuSwitch">
        <tr:navigationPane hint="button">
            <tr:commandNavigationItem text="Home" action="nav_main" />
            <tr:commandNavigationItem text="About" />
            <tr:commandNavigationItem text="Login" action="nav_login" rendered="#{!loginBean.loginStatus}" />
            <tr:commandNavigationItem text="Logut"
                rendered="#{loginBean.loginStatus}" />
        </tr:navigationPane>
...snip
</tr:page>

face-config.xml

<navigation-rule>
    <navigation-case>
        <from-outcome>nav_main</from-outcome>
        <to-view-id>/main.xhtml</to-view-id>
        <redirect/>
    </navigation-case>
    <navigation-case>
        <from-outcome>nav_login</from-outcome>
        <to-view-id>/login.xhtml</to-view-id>
        <redirect/>
    </navigation-case>
 </navigation-rule>

Both the main.xhtml and login.xhtml are sitting inside WebContent and not buried inside another folder.

I read this link: http://myfaces.apache.org/trinidad/devguide/navigation.html

MooCow
  • 367
  • 2
  • 6
  • 24

1 Answers1

0

OK, newbie mistake. I didn't read the entire Trinidad example code and missed a Form tag to surround the entire thing.

<tr:page>
        <f:facet name="menuSwitch">
            <tr:form>
            <tr:navigationPane hint="button">
                <tr:commandNavigationItem text="Home" action="navMain" />
                <tr:commandNavigationItem text="About" />
                <tr:commandNavigationItem text="Login" action="navLogin" rendered="#{!loginBean.loginStatus}" />
                <tr:commandNavigationItem text="Logut"
                    rendered="#{loginBean.loginStatus}" />
            </tr:navigationPane>
            </tr:form>
        </f:facet>
...snip
</tr:page>
MooCow
  • 367
  • 2
  • 6
  • 24