Magazine
 
JSF Tags: Tomahawk Tags

Tomahawk tags are collection of standard components with extended functionality and many more extra set of components with rich set of functionality. If you are going to create a web application in JSF then Tomahawk will be a great weapon because it contains all the commonly used set of components with large options of functionalities. The best way to justify the above fact is exploring some examples of Tomahawk tags. Have a glance on some good tomahawk tags below.

1.Tomahawk jscookMenu tag:

This tag is used to create a menu component in a web 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:

The “layout” attribute provides the layout for the components. The values for this attribute can be hbr, hbl, hur, hul, vbr, vbl, vur, vul. The “theme” attribute is used to specify the theme to be applied on the component. The values for this attribute may be ThemeIE, ThemeMiniBlack, ThemeOffice, ThemePanel. “ThemeIE” value gives a look like Internet Explorer. The navigationMenuItem tag is used to provide the menu items and sub items. The label for the item is set using itemLabel attribute and the action to perform is specified in the action attribute. The icon displayed before the item is set to the icon attribute. Its split attribute is used when we want its sub items.

 

<%@ 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>

Sept 2007 | Java Jazz Up |13
 
previous
index
next
 
Pages: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29,

30
, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53 , 54, 55, 56, 57,

58
, 59, 60, 61, 62, 63 , 64, 65 , 66 , 67 , 68 , 69 , 70, 71, 72, 73, 74, 75, 76, 77, 78, 79,   Download PDF