Project Documentation

Summary

Tag name: <t:jscookMenu>
UIComponent class: org.apache.myfaces.custom.navmenu.jscookmenu.HtmlCommandJSCookMenu
Tag class: org.apache.myfaces.custom.navmenu.jscookmenu.HtmlJSCookMenuTag
Component type: org.apache.myfaces.JSCookMenu
Component family: javax.faces.Command
Renderer type: org.apache.myfaces.JSCookMenu
Renderer class: org.apache.myfaces.custom.navmenu.jscookmenu.HtmlJSCookMenuRenderer

Renders a Javascript Menu. Nested NavigationMenuItem(s) are rendered as Javascript Menu.

This component is based based on the excellent JSCookMenu by Heng Yuan.

Unless otherwise specified, all attributes accept static values or EL expressions.

Screen Shot

jscookmenu

Usage

<t:jscookMenu [ user-role-support-attributes ]
                 [layout="values {hbr, hbl, hur, hul, vbr, vbl, vur, vul}"]
                 [theme="values {ThemeIE, ThemeMiniBlack, ThemeOffice, ThemePanel}"]
    Nested <t:navigationMenuItem> or <t:navigationMenuItems> tags (menu items)
</t:jscookMenu>

Instructions

If you want to use jscookMenu in your application, you will have to:

  • Add jscookmenu directory containing css and scripting code to your web directory (you can find it in the examples application).
  • Add scripts and stylesheets for the theme you would like to use to html-header (see also inc/header.inc in the examples application)
<!-- JSCook Menu -->
<script language="JavaScript" src="jscookmenu/JSCookMenu.js" type="text/javascript">
<script language="JavaScript" src="jscookmenu/ThemeOffice/theme.js"/>
<link rel="stylesheet" href="jscookmenu/ThemeOffice/theme.css" type="text/css"/>
<script language="JavaScript" src="jscookmenu/ThemeMiniBlack/theme.js"/>
<link rel="stylesheet" href="jscookmenu/ThemeMiniBlack/theme.css" type="text/css"/>
<script language="JavaScript" src="jscookmenu/ThemeIE/theme.js"/>
<link rel="stylesheet" href="jscookmenu/ThemeIE/theme.css" type="text/css"/>
<script language="JavaScript" src="jscookmenu/ThemePanel/theme.js"/>
<link rel="stylesheet" href="jscookmenu/ThemePanel/theme.css" type="text/css"/>

see examples/jscookmenu.jsp for an example!

Attributes

Name Type Supports EL? Description
binding String Only EL Identifies a backing bean property (of type UIComponent or appropriate subclass) to bind to this component instance. This value must be an EL expression.
enabledOnUserRole String Yes If user is in given role, this component will be rendered normally. If not, no hyperlink is rendered but all nested tags (=body) are rendered.
id String Yes An identifier for this particular component instance within a component view.

The id must be unique within the scope of the tag's enclosing NamingContainer (eg h:form or f:subview). The id is not necessarily unique across all components in the current view

This value must be a static value, ie not change over the lifetime of a component. It cannot be defined via an EL expression; only a string is permitted.

imageLocation String Yes An alternate location to find image resources. If no values is specified, images will be loaded from the resources directory using AddResource and ExtensionsFilter.
immediate boolean Yes A boolean value that identifies the phase during which action events should fire. During normal event processing, action methods and action listener methods are fired during the "invoke application" phase of request processing. If this attribute is set to "true", these methods are fired instead at the end of the "apply request values" phase.
javascriptLocation String Yes An alternate location to find javascript resources. If no values is specified, javascript will be loaded from the resources directory using AddResource and ExtensionsFilter.
layout String Yes
rendered boolean Yes A boolean value that indicates whether this component should be rendered. Default value: true.
styleLocation String Yes An alternate location to find stylesheet resources. If no values is specified, stylesheets will be loaded from the resources directory using AddResource and ExtensionsFilter.
theme String Yes
visibleOnUserRole String Yes If user is in given role, this component will be rendered normally. If not, nothing is rendered and the body of this tag will be skipped.