Skip to content

OnContextMenuOpen - cWebContextMenu

Fired whenever the ContextMenu is activated on a valid context

Type: Event

Parameters

Parameter Type Description
ByRef bCancel Boolean Can be used to cancel opening the menu

Syntax

Procedure OnContextMenuOpen ByRef Boolean bCancel

Description

OnContextMenuOpen is an event that is triggered whenever the ContextMenu is activated on a valid context.

By this time, psContextValue is already updated.

This Event is blocking, which means that the menu won't open before the event has returned. By that time, using the bCancel-parameter, the open can be canceled.

The event can be enabled using pbServerOnContextMenuOpen and psClientOnContextMenuOpen.

Sample

This sample shows how to cancel the context menu activation based on the psContextValue.

Procedure OnContextMenuOpen Boolean ByRef bCancel
    String sRowId

    WebGet psContextValue of oWebListContextMenu to sRowId
    If (sRowId = "1") Move True to bCancel
End_Procedure