The Common-Controls Tag Library

<menu:menuitem>

A menu definition is declared with this tag. A menu entry can itself in turn contain additional <menu:menuitem>-tags.
The tag can only be used within <menu:menu> and <menu:menuitem>-tags.

Body content: JSP
Tag class: MenuItemTag
 

[ Syntax ]

Standard Syntax
<menu:menuitem
[ action = "String" ]
[ filter = "String" ]
[ id = "String" ]
[ imageref = "String" ]
[ locale = "String" ]
[ menuid = "String" ]
[ onblur = "String" ]
[ onchange = "String" ]
[ onclick = "String" ]
[ oncontextmenu = "String" ]
[ ondblclick = "String" ]
[ onfocus = "String" ]
[ onkeydown = "String" ]
[ onkeypress = "String" ]
[ onkeyup = "String" ]
[ onmousedown = "String" ]
[ onmousemove = "String" ]
[ onmouseout = "String" ]
[ onmouseover = "String" ]
[ onmouseup = "String" ]
[ orientation = "{horizontal | vertical}" ]
[ permission = "ACL" ]
[ shortcut = "String" ]
[ state = "{enabled | disabled | checked | unchecked | visible | invisible | popup}" ]
[ target = "String" ]
[ text = "String" ]
[ tooltip = "String" ]
[ width = "String" ]
>
...Body Content...

</menu:menuitem>
 

[ Attributes ]

AttributeTypeDescriptionReq.RTExp
actionString Specifies the Struts Action that is to be called upon selection of a menu option.  
filterString Defines the optional filter condition(s) for this menu option. The menu context filter must tally with at least one filter so that the menu option is displayed.

Annotation: Several filters are delimited with ";".

 
idString The name of a page scope JSP bean that will contain the current element. Using the given Id, the variable can be accessed in scripting expressions in the tag Body. The id mus be a string lteral because the JSP compiler generates a variable withthis name at compile time

Annotation: A valid Java identifier must be given.

 
imagerefString The Painter appends to the imageref-value implicit, the following suffixes in order to distinguish between different states.

The Painter appends to the imageref-value implicit, the following suffixes in order to distinguish between different states:

  • .sel = selected menu entry.
  • .dis = disabled.
  • .unsel = de-selected menu entry.

 
localeString enables localization for the control element. String literals will be interpreted as keys in the Application.properties file.

Annotation: boolean value true oder false oder the name of a locale.

 
menuidString Defines the internally used identificator of the menu option. A menu path is formed by concatenatingf the menu id's across the declaration hierarchy.

A menu option can be considered to be selected when the current menu context path starts with the menu path!

Annotation: Individual path elements are delimited with "/".

 
onblurString Fires when the object loses the input focus.

Annotation: JavaScript Code

 
onchangeString Fires when the contents of the object or selection have changed.

Annotation: JavaScript Code

 
onclickString Fires when the user clicks the left mouse button on the object.

Annotation: JavaScript Code

 
oncontextmenuString Fires when the user clicks the right mouse button in the client area, opening the context menu.

Annotation: JavaScript Code

 
ondblclickString Fires when the user double-clicks the object.

Annotation: JavaScript Code

 
onfocusString Fires when the object receives focus.

Annotation: JavaScript Code

 
onkeydownString Fires when the user presses a key.

Annotation: JavaScript Code

 
onkeypressString Fires when the user presses an alphanumeric key.

Annotation: JavaScript Code

 
onkeyupString Fires when the user releases a key.

Annotation: JavaScript Code

 
onmousedownString Fires when the user clicks the object with either mouse button.

Annotation: JavaScript Code

 
onmousemoveString Fires when the user moves the mouse over the object.

Annotation: JavaScript Code

 
onmouseoutString Fires when the user moves the mouse pointer outside the boundaries of the object.

Annotation: JavaScript Code

 
onmouseoverString Fires when the user moves the mouse pointer into the object.

Annotation: JavaScript Code

 
onmouseupString Fires when the user releases a mouse button while the mouse is over the object.

Annotation: JavaScript Code

 
orientation
  • horizontal =
  • vertical =
 
permissionACL With this attribute, access to the element can be restricted.

Authorizations are checked using the com.cc.framework.security.Principal object in the user session. The principal object is registered in the session with the method com.cc.framework.security.SecurityUtil#registerPrincipal(HttpSession, Principal). It is made available by the application developer by implementing the principal interface. In this manner, any authorization system can be very easily connected within the framework.

Authorizations are always specified in the form of an Access Control List (ACL). What is involved here is a semicolon-delimited list with individual authorizations. The framweork supports the following authorization types, which, however, can be expanded at will by the application developer:

Literal
true|false -> com.cc.framework.security.StaticPermission
Role
#rolename -> com.cc.framework.security.RoleBasedPermission
Function
$functionname -> com.cc.framework.security.FunctionBasedPermission

 
shortcutString A keyboard shortcut for the menu entry.  
stateMenuStateType Specifies the state of the menu option.
  • enabled = menu option active.
  • disabled = menu option is inactive and not selectable.
  • checked = menu option is marked.
  • unchecked = menu option is not marked.
  • visible = menu option is visible.
  • invisible = menu option is invisible.
  • popup =
 
targetString The HTML-target attribute of the element can be specified with this attribute.

Annotation: See HTML documentation for the attribute target.

 
textString The actual labelling of the menu option. This must also be specified if an image is to be used for the menu option.  
tooltipString A short descriptive text that is displayed when the user moves the mouse over the element.  
widthString Sets the width of the control element. The height may be specified in absolute or percent terms.

See the HTML documentation

 

[ Example ]

Generates a hierarchical menu.


<%@ taglib uri="http://www.common-controls.com/cc/tags-menu"  prefix="menu" %>

<menu:menu  id="admin"  type="sidebar"  width="150">

    <menu:menuitem  id="tools"         text="Tools"                action="sessionbrowse.do">
        <menu:menuitem  id="sessions"  text="Active Sessions"      action="sessionbrowse.do"/>
        <menu:menuitem  id="log"       text="Log Files"            action="logbrowse.do"  permission="#admin"/>
        <menu:menuitem  id="sqlquery"  text="Database Query Tool"  action="query.do"      permission="#admin"/>
        <menu:menuitem  id="shutdown"  text="Shutdown Manager"     action="shutdown.do"   permission="#admin"/>
    </menu:menuitem>

    <menu:menuitem  id="profile"       text="User Profile"         action="userprofile.do">
        <menu:menuitem  id="edit"      text="Edit Profile"         action="userprofile.do"/>
        <menu:menuitem  id="password"  text="Change Password"      action="changepwd.do"/>
    </menu:menuitem>
</menu:menu>