ALP MenuSelectHandler and MenuSelectHandlerNamespace
These two properties are used to specify a script routine within a DHTML page to handle the menu select notifications. Menu select notification is send when the user walks through the menu (window or pop-up). Handler routine is able to inspect the menu currently selected and do perform actions - such as displayng hint string somewhere on the page, change some image and so on.

Syntax and description

external.MenuSelectHandler - string - Read/Write. Specifies the script function to be called to handle the notification. Only the function name must be specified (no brackets or parameters). For example:

external.MenuSelectHandler = "MySelectMenuHandler";
In the page function should be defined as:
function MySelectMenuHandler(sender) {
   // Implementation ...
}
sender
parameter is the MenuItem object currently selected by the user.
The property can be inspected by the script in order to determine the currently registered handler.

external.MenuSelectHandlerNamespace - string - Read/Write. Specifies the namespace that holds the function specified in the MenuSelectHandler property. the string syntax is "namespacetype=namespacename". Currently only frame is supported as namespace type. In case of no frames property should be empty (i.e. care about it only if you have frames). Example:

external.MenuSelectHandlerNamespace = "frame=main";
If you have a FRAMESET with a frame called "main" or IFRAME with that name.

Remarks

Most of the desktop applications track the pop-up menus and for example display some hint text about the menu items selected by the user in the status bar. With ALPFrame DTHML pages are able to do something similar or more complex in response to the menu tracking. Handler function receives as parameter the menu item that is currently selected (not yet clicked) and is able to use for example its info property or more complex logic to determine what to do. For example this function is able to change the DHTML page, some text in it or/and a hint images and so on.

The only suggestion to the developers is to take care about the time needed to perform the task. Menu selection changes as the user moves the mouse through the menu thus for example downloading an image from the network for the selection will be too slow, but changing a text and/or style of some elemnt(s) of the page will be fast enough. It is recommended to make a test on a slower machine if you are going to implement a complex processing and optimize that part of your page for higher performance.

For example usage see the elements example in the ALPFrame samples.

Note that the similar properties - InitMenuHandler and InitMenuHandlerNamespace have different purpose. They are used to specify a routine to inspect the menu items state before entering the window menu and MenuSelectHandler is used to specify handler for the menu tracking - changing the state of the menu items in the code that handles the menu selection is not appropriate.

Applies to: external

newObjects Copyright 2001-2006 newObjects [ ]