Click or drag to resize
MenuItem

A MenuItem is a clickable element in a menu.

The action can be either a link to another page or a call to a javascript function.

A MenuItem can contain a nested Menu.

Attributes and elements

The following sections describe attributes, child elements, and parent elements.

Attributes

Attribute

Description

id

unique identifier for this menu item; it must be unique amongst its brother items

selected

XPath expression that will be used to determine if this item has the "selected" class to display it differently

label

XPath attribute; text for this menu item

action

javascript code to be called when the user clicks on this item

link

URL to go to when the user clicks on this item. If both action and link are defined, action takes precedence

target

If this menu item is a link, the name of the target window

Child elements

Element

Description

acs:Menu

A sub menu starting at this menu item

Parent elements

Element

Description

acs:Menu

The parent menu for this item

Styling information

The XHTML structure created by the acs:MenuItem is the following:

<li id="{@id of the parent menu}_{@id}" class="menuitem [if selected]selected[/end if]">
  <!-- if @action -->
  <span id="menu{@id of the parent menu}_{@id}" class="button">@label</span>
  <!-- if @link -->
  <a id="menu{@id of the parent menu}_{@id}" href="{@link}" target="{@target}">@label</a>
  <!-- the submenu div -->
  <div id="menudiv{@id of the parent}_{@id}" style="display:none;z-index:100;position: relative;">
    <!-- the submenu -->
  </div>
</li>
Examples
<acs:Menu id="myid">
  <acs:MenuItem id="myid1" label="My first item" action="goto1()"/>
  <acs:MenuItem id="myid2" label="My second item" link="http://www.yoocan.fr" target="_blank"/>
</acs:Menu>