OnItemClick - cWebToolBar

Fires when a dynamically defined menu item is clicked

Type: Event

Parameters: String sId String sCaption

ParameterDescription
sIdUnique identifier of the menu item
sCaptionMenu item caption


Syntax
Procedure OnItemClick String sId String sCaption

Description

This event fires when a dynamically defined menu item is clicked.

Dynamic menu items can be defined in OnDefineMenu.

Object oWebMenuButton is a cWebMenuButton
    Set psCaption to "Menu"
    Set pbMenuShowCaption to False
    
    Procedure OnDefineMenu tWebMenuItem[] ByRef aMenu
        Move "1"        to aMenu[0].sId
        Move "Item 1"   to aMenu[0].sCaption
        Move True       to aMenu[0].bEnabled

        Move "2"        to aMenu[1].sId
        Move "Item 2"   to aMenu[1].sCaption
        Move True       to aMenu[1].bEnabled
        
        Move "2.1"      to aMenu[1].aChildren[0].sId
        Move "Item 2.1" to aMenu[1].aChildren[0].sCaption
        Move True       to aMenu[1].aChildren[0].bEnabled
        
    End_Procedure
    
    Procedure OnItemClick String sId String sCaption
        Send ShowInfoBox (SFormat("Dynamic menu item '%1' was clicked!", sCaption))
    End_Procedure
End_Object