Editing the menu

You can manipulate the menu via the IWebMenu interface defined in the Act.Web.Framework assembly. Plug-ins access the menu via the Menu property of the ACTSessionManager. To insure the integrity of the menu, this object should not be held across function calls. The interfaces used to manipulate the menu are as follows:

IWebMenu

Properties

Returns the list of top level menu items.

Methods

Includes the specified javascript file in the menu section. Functions defined in the javascript file can be used by added menu items.

IWebMenuItemCollection

Properties

Returns the menu item with the specified id in the collection. If the item does not exist in the collection, then null is returned. Default menu ids can be found in menu.xml.

Returns the menu item at the specified index in the collection. If the index is less than zero or greater than or equal to the number of items in the collection, then null is returned.

Methods

Adds a menu item to the end of the collection. Returns the newly created menu item.

Parameters

Id: A unique string used to identify the menu item. If the menu item is not at the top level then the id is pre-pended with the ids of its parents separated by a colon. (i.e. Adding a menu item with the id “MyItem” to the Contact menu will result in an id of c:MyItem.)

caption: The text that is displayed. This should be localized by the plug-in.

type: The type of action taken when the item is clicked. Top level menu items default to “none”.

action: The action to take when the item is selected. If the type is “JS” then action should be the javascript function to execute. If the type is “submenu” then the action should be the id of the submenu.

enabled: Whether or not the item is initially enabled.

Adds a menu item at the specified location in the collection. If the index is less than zero an ArgumentOutOfRangeException is thrown. If the index is greater than the last item then the new item is appended to the end of the collection. All other parameters are the same as above.

Removes the menu item with the specified id from the collection. If the id does not exist in the collection then an ArgumentException is thrown.

Removes the menu item at the specified index in the collection. If the index is less than zero or past the end of the collection, then an ArgumentOutOfRangeException is thrown.

IWebMenuItem

Properties

Returns the collection of subitems for the menu item. If there are no subitems, then null is returned.

Gets or sets the enabled state of the menu item. The page must be reloaded before any changes will take effect.

Returns the text displayed by the menu item.

Returns the id of the menu item.

How do I...?

Add a tab

Add a plug-in

Add a navigation bar item 

Edit a toolbar