myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Paul Baker" <pbake...@mindspring.com>
Subject [Trinidad] MenuModel - duplicate tabs/menubar items
Date Thu, 21 Jun 2007 21:37:43 GMT
Hi,

 

I'm new to Trinidad. I'm trying to create a MenuModel and I'm having several
problems. Then only documentation that I have found is at:

http://myfaces.apache.org/trinidad/devguide/navigation.html

 

My "test" menu structure is:

 

Depth 0      a1          a2

            /  \ 

Depth 1   a1b1 a1b2

 

When tab a1 is selected I want to display page a1b1

When tab a2 is selected I want to display page a2

 

 

Problem 1:

The menu items are being duplicated on both navigationPanes (tab and below
tab, a menu bar).  I have attached a screen shot.

 



Problem 2:

When I select tab a1b2 page a1b1 is displayed.

 

Problem 3:

The tabs and menu bar items are never displayed as selected. 

 

All of the pages are basically the same:

 

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<f:view>

 <tr:document title="navigationPane Demo">

  <tr:form> 

   <tr:panelGroupLayout layout="vertical">

    <tr:panelPage>

      <f:facet name="navigation2">

       <tr:navigationPane hint="tabs"  var="foo"
value="#{navigationModel.model}">

        <f:facet name="nodeStamp">

         <tr:commandNavigationItem text="#{foo.label}"
action="#{foo.getOutcome}" />

        </f:facet>

       </tr:navigationPane>

      </f:facet>

      <f:facet name="navigation3">

       <tr:navigationPane hint="bar" level="1" var="foo"
value="#{navigationModel.model}">

        <f:facet name="nodeStamp">

         <tr:commandNavigationItem text="#{foo.label}"
action="#{foo.getOutcome}" />

        </f:facet>

      </tr:navigationPane>

     </f:facet>

    </tr:panelPage>

    a1b1 

   </tr:panelGroupLayout>

  </tr:form>

 </tr:document>

</f:view>

 

Here is the faces-config.xml:

 

<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE faces-config PUBLIC "-//Sun Microsystems, Inc.//DTD JavaServer
Faces Config 1.1//EN" "http://java.sun.com/dtd/web-facesconfig_1_1.dtd">

 

<faces-config>

 

      <application>

            <default-render-kit-id>

                  org.apache.myfaces.trinidad.core

            </default-render-kit-id>

      </application>

 

      <navigation-rule>

            <navigation-case>

                  <from-outcome>guide.navigationModel_a1b1</from-outcome>

                  <to-view-id>/pages/page_a1b1.jsp</to-view-id>

                  <redirect />

            </navigation-case>

            <navigation-case>

                  <from-outcome>guide.navigationModel_a1b2</from-outcome>

                  <to-view-id>/pages/page_a1b2.jsp</to-view-id>

                  <redirect />

            </navigation-case>

            <navigation-case>

                  <from-outcome>guide.navigationModel_a2</from-outcome>

                  <to-view-id>/pages/page_a2.jsp</to-view-id>

                  <redirect />

            </navigation-case>

            <navigation-case>

                  <from-outcome>*</from-outcome>

                  <to-view-id>/page.jsp</to-view-id>

                  <redirect />

            </navigation-case>

      </navigation-rule>

 

      <navigation-rule>

            <from-view-id>*</from-view-id>

            <navigation-case>

                  <to-view-id>/page.jspx</to-view-id>

                  <redirect />

            </navigation-case>

      </navigation-rule>

 

 

 

      <managed-bean>

            <managed-bean-name>prefs</managed-bean-name>

            <managed-bean-class>

                  org.apache.myfaces.trinidaddemo.PreferencesProxy

            </managed-bean-class>

            <managed-bean-scope>application</managed-bean-scope>

      </managed-bean>

 

      <managed-bean>

            <managed-bean-name>navItem_a1b1</managed-bean-name>

            <managed-bean-class>

                  org.apache.myfaces.trinidaddemo.nav.DemoNavigationItem

            </managed-bean-class>

            <managed-bean-scope>none</managed-bean-scope>

            <managed-property>

                  <property-name>label</property-name>

                  <value>a1b1</value>

            </managed-property>

            <managed-property>

                  <property-name>viewId</property-name>

                  <value>/pages/page_a1b1.jsp</value>

            </managed-property>

            <managed-property>

                  <property-name>outcome</property-name>

                  <value>guide.navigationModel_a1b1</value>

            </managed-property>

      </managed-bean>

 

      <managed-bean>

            <managed-bean-name>navItem_a1b2</managed-bean-name>

            <managed-bean-class>

                  org.apache.myfaces.trinidaddemo.nav.DemoNavigationItem

            </managed-bean-class>

            <managed-bean-scope>none</managed-bean-scope>

            <managed-property>

                  <property-name>label</property-name>

                  <value>a1b2</value>

            </managed-property>

            <managed-property>

                  <property-name>viewId</property-name>

                  <value>/pages/page_a1b2.jsp</value>

            </managed-property>

            <managed-property>

                  <property-name>outcome</property-name>

                  <value>guide.navigationModel_a1b2</value>

            </managed-property>

      </managed-bean>

 

      <managed-bean>

            <managed-bean-name>navItem_a1</managed-bean-name>

            <managed-bean-class>

                  org.apache.myfaces.trinidaddemo.nav.DemoNavigationItem

            </managed-bean-class>

            <managed-bean-scope>none</managed-bean-scope>

            <managed-property>

                  <property-name>children</property-name>

                  <list-entries>

                        <value-class>

 
org.apache.myfaces.trinidaddemo.nav.DemoNavigationItem

                        </value-class>

                        <value>#{navItem_a1b1}</value>

                        <value>#{navItem_a1b2}</value>

                  </list-entries>

            </managed-property>

            <managed-property>

                  <property-name>label</property-name>

                  <value>a1</value>

            </managed-property>

            <managed-property>

                  <property-name>viewId</property-name>

                  <value>/pages/page_a1b1.jsp</value>

            </managed-property>

            <managed-property>

                  <property-name>outcome</property-name>

                  <value>guide.navigationModel_a1b1</value>

            </managed-property>

      </managed-bean>

 

      <managed-bean>

            <managed-bean-name>navItem_a2</managed-bean-name>

            <managed-bean-class>

                  org.apache.myfaces.trinidaddemo.nav.DemoNavigationItem

            </managed-bean-class>

            <managed-bean-scope>none</managed-bean-scope>

            <managed-property>

                  <property-name>label</property-name>

                  <value>a2</value>

            </managed-property>

            <managed-property>

                  <property-name>viewId</property-name>

                  <value>/pages/page_a2.jsp</value>

            </managed-property>

            <managed-property>

                  <property-name>outcome</property-name>

                  <value>guide.navigationModel_a2</value>

            </managed-property>

      </managed-bean>

 

      <managed-bean>

            <managed-bean-name>navTreeList</managed-bean-name>

            <managed-bean-class>java.util.ArrayList</managed-bean-class>

            <managed-bean-scope>none</managed-bean-scope>

            <list-entries>

                  <value-class>

 
org.apache.myfaces.trinidaddemo.nav.DemoNavigationItem

                  </value-class>

                  <value>#{navItem_a1}</value>

                  <value>#{navItem_a2}</value>

            </list-entries> 

      </managed-bean>

 

      <managed-bean>

            <managed-bean-name>navTreeModel</managed-bean-name>

            <managed-bean-class>

                  org.apache.myfaces.trinidad.model.ChildPropertyTreeModel

            </managed-bean-class>

            <managed-bean-scope>none</managed-bean-scope>

            <managed-property>

                  <property-name>childProperty</property-name>

                  <value>children</value>

            </managed-property>

            <managed-property>

                  <property-name>wrappedData</property-name>

                  <value>#{navTreeList}</value>

            </managed-property>

      </managed-bean>

 

 

      <managed-bean>

            <managed-bean-name>viewIdNavigationModel</managed-bean-name>

            <managed-bean-class>

                  org.apache.myfaces.trinidad.model.ViewIdPropertyMenuModel

            </managed-bean-class>

            <managed-bean-scope>none</managed-bean-scope>

            <managed-property>

                  <property-name>viewIdProperty</property-name>

                  <value>viewId</value>

            </managed-property>

            <managed-property>

                  <property-name>wrappedData</property-name>

                  <value>#{navTreeModel}</value>

            </managed-property>

      </managed-bean>

 

      <managed-bean>

            <managed-bean-name>navigationModel</managed-bean-name>

            <managed-bean-class>

                  org.apache.myfaces.trinidaddemo.nav.MenuModelAdapter

            </managed-bean-class>

            <managed-bean-scope>session</managed-bean-scope>

            <managed-property>

                  <property-name>model</property-name>

                  <value>#{viewIdNavigationModel}</value>

            </managed-property>

            <managed-property>

                  <property-name>aliasList</property-name>

                  <list-entries>

                        <value-class>java.lang.String</value-class>

                        <value>/pages/page_a1b1.jsp</value>

                        <value>#{navItem_a1b1.viewId}</value>

                        <value>/pages/page_a2.jsp</value>

                        <value>#{navItem_a2.viewId}</value>

                  </list-entries>

            </managed-property>

      </managed-bean>

 

</faces-config>

 

 

The classes:

MenuModelAdapter and DemoNavigationItem were taken from Trinidad CVS.

 

Any help or pointers will be greatly appreciated.

 

Thanks in advance, 

 

Paul


Mime
View raw message