* 在jscookMenu所在的form里面添加:<input id="jscook_action" name="jscook_action" type="hidden"/>
不加这句的话,就只会显示cookMenu,但是不能够使用action跳转
(这在网上找了N久才找到的。。。
http://chinabin.bokee.com/6741696.html 貌似是这个地方。。。。哈哈
)
<h:form id="popup_form">
<input id="jscook_action" name="jscook_action" type="hidden"/>
<h:panelGrid columns="1" style="border: solid 1px blue" >
<t:jscookMenu layout="hbr" theme="ThemeOffice">
<t:navigationMenuItems value="#{userManager.vo.navItems}" />
</t:jscookMenu>
// public NavigationMenuItem[] getNavItems() {
// NavigationMenuItem[] subItems = new NavigationMenuItem[2];
// subItems[0] = new
NavigationMenuItem("Subitem 2_1
Label","/index.jsf","/img/img_01.jpg",false); //可以跳转
// subItems[1] = new
NavigationMenuItem("Subitem 2_2
Label","index.jsf","img/img_01.jpg",false); //这种方式不能跳转
//
// // item 2
// NavigationMenuItem itemWithChildren = new NavigationMenuItem("Item 2 Label", "action2");
// itemWithChildren.setNavigationMenuItems(subItems);
//
// // root items
// navItems = new NavigationMenuItem[3];
// navItems[0] = new NavigationMenuItem("Item 1 Label","index"); //可以跳转
// navItems[1] = itemWithChildren;
// navItems[2] = new NavigationMenuItem("Item 3 Label","action3");
//
// System.out.println("00000000000");
//
// return navItems;
// }
<t:jscookMenu layout="hbr" theme="ThemeOffice">
<t:navigationMenuItem itemLabel="File">
<t:navigationMenuItem action="new-file" itemLabel="New">
<t:navigationMenuItem action="open-file" itemLabel="new_1"/>
<t:navigationMenuItem action="open-file" itemLabel="new_2"/>
</t:navigationMenuItem>
<t:navigationMenuItem action="open-file" itemLabel="Open"/>
<t:navigationMenuItem action="open-file"
itemLabel="Close" rendered="#{menuBean.closeFileAvailable}"/>
<t:navigationMenuItem action="index" itemLabel="返回"/>
</t:navigationMenuItem>
<t:navigationMenuItem itemLabel="Edit">
<t:navigationMenuItem action="#{userManager.goTo}" itemLabel="New"/>
<t:navigationMenuItem actionListener="#{userManager.goTo}" action="index" itemLabel="返回"/>
</t:navigationMenuItem>
</t:jscookMenu>
<t:panelNavigation2>
<t:commandNavigation2>
<h:outputText value="网站"/>
<t:commandNavigation2 externalLink="http://www.baidu.com">
<h:outputText value="百度"/>
</t:commandNavigation2>
<t:commandNavigation2 externalLink="http://www.sina.com">
<h:outputText value="新浪"/>
</t:commandNavigation2>
</t:commandNavigation2>
</t:panelNavigation2>
</h:panelGrid>
</h:form>