You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by gsilverman <GS...@dylt.com> on 2008/09/09 20:01:23 UTC

Possible bug in XMLMenuModel more than one level deep?

I can't seem to get an XMLMenuModel to work with more than one level of menu
items. Navigation always returns to the first level of menu items after a
button click. I posted this problem earlier under a different subject
heading, but perhaps my example there was too complicated. 
See: 
http://www.nabble.com/How-can-I-preventTrinidad--navigationPane-from-going-back-to-the-first-groupNode-in-the-menu-model-td19381895.html
http://www.nabble.com/How-can-I-preventTrinidad--navigationPane-from-going-back-to-the-first-groupNode-in-the-menu-model-td19381895.html 


IMO this is a major problem that prevents any real use of XMLMenuModel
navigation. Here's a simpler way to illustrate the problem:

Create an XMLMenuModel with at least level 0 and level 1 items. Then use it
on a panelPage with  navigation3 and navigation1 facets. Add a commandButton
to the content area of the panelPage and try navigation through the menus
after clicking the button. You can't do it. Navigation always returns to the
first level 0 menu item. The result is that any menu more than 1 level deep
is useless.

Your panelPage can be as simple as this:

<tr:form>
				<tr:panelPage>
						<f:facet name="navigation3">
				            <tr:navigationTree var="foo" value="#{root_menu}">
				              <f:facet name="nodeStamp">
				                <tr:commandNavigationItem 
				                  text="#{foo.label}"
				                  action="#{foo.doAction}"/>
				              </f:facet>
				            </tr:navigationTree>
          				</f:facet>
			            <f:facet name="navigation1">
			              <tr:navigationPane id="np1" var="foo" value="#{root_menu}"
level="1">
			                <f:facet name="nodeStamp">
			                  <tr:commandNavigationItem 
			                    text="#{foo.label}"
			                    action="#{foo.doAction}"/>
			                </f:facet>                            
			              </tr:navigationPane>
                         </f:facet>	
                    <tr:commandButton id="cmd2" text="Enter" />
                     	
				</tr:panelPage>
			 </tr:form>
			

If anyone is using XMLMenuModels more than 1 level deep, please let me know
how you do it.
-- 
View this message in context: http://www.nabble.com/Possible-bug-in-XMLMenuModel-more-than-one-level-deep--tp19397867p19397867.html
Sent from the MyFaces - Users mailing list archive at Nabble.com.