MetaAttributesBreadcrumb.OnBeforeReplaceItem

Syntax

Sub OnBeforeReplaceItem(Sender: Object; Args: IMetaAttributeBreadcrumbReplaceItemEventArgs);

Begin

//set of operators;

End Sub OnBeforeReplaceItem;

Parameters

Sender. The parameter that returns the component that generated the event.

Args. The parameter that enables the user to determine event parameters.

Description

The OnBeforeReplaceItem event occurs before component elements are replaced.

Comments

It is possible to organize checking of replaced elements in this event, using property of the Attribute argument. After the Allow property is set to the corresponding value, element replacement can be allowed or prohibited.

Example

Executing the example requires a form with the MetaAttributesBreadcrumb component named MetaAttributesBreadcrumb1. This component is connected to any time series database. The specified procedure is set for MetaAttributesBreadcrumb1 as a handler of the OnBeforeReplaceItem event.

    Sub MetaAttributesBreadcrumb1OnBeforeReplaceItem(
        Sender: Object; Args: IMetaAttributeBreadcrumbReplaceItemEventArgs);
    Var
        Item: IMetaAttributeBreadcrumbItem;
    Begin
        Item := Args.Item As IMetaAttributeBreadcrumbItem;
        If (Item.MetaAttribute.Id = "DL"And (Args.Attribute = "COUNTRY"Then
            Args.Allow := False;
        End If;
    End Sub MetaAttributesBreadcrumb1OnBeforeReplaceItem;

When the event occurs, attribute identifiers are checked. If replaceable element corresponds to attribute with the DL identifier, and the user tries to replace it by attribute with the COUNTRY identifier, replacement is prohibited.

See also:

MetaAttributesBreadcrumb