This tag is used to create menu component in the page.
To display the items navigationMenuItem or navigationMenuItems tag are used. In
the following example, we have used theme that looks just as in Internet
Explorer.
Code Description :
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%> <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%> <%@ taglib uri="http://myfaces.apache.org/tomahawk" prefix="t"%> <html> <head> <title>t:jscookMenu example</title> </head> <body> <f:view> <h:form> <t:jscookMenu layout="hbr" theme="ThemeIE" > <t:navigationMenuItem id="nmi1" itemLabel="Menu1"> <t:navigationMenuItem id="nmi1_1" itemLabel="Menu11" action="welcome" /> <t:navigationMenuItem id="nmi1_2" itemLabel="menu12" action="welcome" /> <t:navigationMenuItem id="nmi1_3" itemLabel="menu13" action="welcome" /> <t:navigationMenuItem id="nmi1_4" itemLabel="menu14" split="true"> <t:navigationMenuItem id="nmi14_1" itemLabel="menu141" action="welcome" /> <t:navigationMenuItem id="nmi14_2" itemLabel="menu142" action="welcome"/> <t:navigationMenuItem id="nmi14_3" itemLabel="menu143" action="welcome" /> <t:navigationMenuItem id="nmi14_4" itemLabel="menu144" action="welcome"/> </t:navigationMenuItem> </t:navigationMenuItem> </t:jscookMenu> </h:form> </f:view> </body> </html>
Rendered Output :

Html Source Code :
<html>
<head>
<script type="text/javascript" src="/tomahawk_tags/faces/
myFacesExtensionResource/org.apache.myfaces.renderkit.html.util.
MyFacesResourceLoader/11862282/navmenu.jscookmenu.HtmlJSCookMenuRenderer
/JSCookMenu.js"><!--
//--></script>
<script type="text/javascript" src="/tomahawk_tags/faces/
myFacesExtensionResource/org.apache.myfaces.renderkit.html.util.
MyFacesResourceLoader/11862282/navmenu.jscookmenu.HtmlJSCookMenuRenderer
/MyFacesHack.js"><!--
//--></script>
<script type="text/javascript"><!--
var myThemeIEBase='/tomahawk_tags/faces/myFacesExtensionResource/
org.apache.myfaces.renderkit.html.util.MyFacesResourceLoader/11862282
/navmenu.jscookmenu.HtmlJSCookMenuRenderer/ThemeIE/';
//--></script>
<script type="text/javascript" src="/tomahawk_tags/faces/
myFacesExtensionResource/org.apache.myfaces.renderkit.html.util.
MyFacesResourceLoader/11862282/navmenu.jscookmenu.HtmlJSCookMenuRenderer/
ThemeIE/theme.js"><!--
//--></script>
<link rel="stylesheet" href="/tomahawk_tags/faces/myFacesExtensionResource/
org.apache.myfaces.renderkit.html.util.MyFacesResourceLoader/11862282/
navmenu.jscookmenu.HtmlJSCookMenuRenderer/ThemeIE/theme.css"
type="text/css" />
<title>t:jscookMenu example</title>
</head>
<body>
<form id="_idJsp0" name="_idJsp0" method="post" action="/tomahawk_tags/
pages/jscookMenu.jsf" enctype="application/x-www-form-urlencoded">
<script type="text/javascript"><!--
var idJsp0__idJsp1_menu =
[[null, 'Menu1', null, '_idJsp0', null,[null, 'Menu11', 'idJsp0__
idJsp1_menu:A]welcome', '_idJsp0', null],
[null, 'menu12', 'idJsp0__idJsp1_menu:A]welcome', '_idJsp0', null],
[null, 'menu13', 'idJsp0__idJsp1_menu:A]welcome', '_idJsp0', null],
_cmSplit,[null, 'menu14', null, '_idJsp0', null,[null, 'menu141',
'idJsp0__idJsp1_menu:A]welcome', '_idJsp0', null],
[null, 'menu142', 'idJsp0__idJsp1_menu:A]welcome', '_idJsp0', null],
[null, 'menu143', 'idJsp0__idJsp1_menu:A]welcome', '_idJsp0', null],
[null, 'menu144', 'idJsp0__idJsp1_menu:A]welcome', '_idJsp0', null]]]];
//--></script><div id="idJsp0__idJsp1_menu"></div>
<script type="text/javascript"><!--
if(window.cmDraw!=undefined) { cmDraw ('idJsp0__idJsp1_menu',
idJsp0__idJsp1_menu, 'hbr', cmThemeIE, 'ThemeIE');}
//--></script>
<input type="hidden" name="_idJsp0_SUBMIT" value="1" />
<input type="hidden" name="jscook_action" />
<script type="text/javascript"><!--
function clear__5FidJsp0()
{
clearFormHiddenParams__idJsp0('_idJsp0');
}
function clearFormHiddenParams__idJsp0(currFormName)
{
var f = document.forms['_idJsp0'];
f.elements['jscook_action'].value='';
f.target='';
}
clearFormHiddenParams__idJsp0();
//--></script><input type="hidden" name="javax.faces.ViewState"
id="javax.faces.ViewState" value="rO0ABXVyABNbTGphdmEubGFuZy5PYmp
lY3Q7kM5YnxBzKWwCAAB4cAAAAANzcgBHb3JnLmFwYWNoZS5teWZhY2VzLmFwcGxp
Y2F0aW9uLlRyZWVTdHJ1Y3R1cmVNYW5hZ2VyJFRyZWVTdHJ1Y3RDb21wb25lbnRGW
RfYnEr2zwIABFsACV9jaGlsZHJlbnQASltMb3JnL2FwYWNoZS9teWZhY2VzL2" />
</form>
<!-- MYFACES JAVASCRIPT -->
</body>
</html>
This tag contains attributes given below :
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.
Ask Questions? Discuss: Tomahawk jscookMenu tag View All Comments
Post your Comment