MetaAttributesBreadcrumb.OnBeforeReplaceItem

Fore Syntax

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

Begin

//set of operators;

End Sub OnBeforeReplaceItem;

Fore.NET Syntax

None;

Parameters

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

The Args parameter allows to determine event parameters.

Description

The OnBeforeReplaceItem event occurs before a component element is replaced.

Comments

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

Fore Example

Executing the example requires a form with the MetaAttributesBreadcrumb component named MetaAttributesBreadcrumb1. This component is connected to any time series database. The defined procedure is set for MetaAttributesBreadcrumb1 as 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, attributes 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, substitution is prohibited.

See also:

MetaAttributesBreadcrumb