SelectedElems: IMetabaseObjectDescriptors;
The SelectedElems property returns descriptions of elements selected in the tree with validation rules.
Executing the example requires a form with the button named Button1 on it, the WorkbookConfigurationPanel component named WorkbookConfigurationPanel1 and the UiErAnalyzer component named UiErAnalyzer1. UiErAnalyzer1 is connected to a workbook and it is installed as a data source for the WorkbookConfigurationPanel1 component.
Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
Pad: ISystemPadContext;
SelectedElems: IMetabaseObjectDescriptors;
Desc: IMetabaseObjectDescriptor;
Begin
Pad := WorkbookConfigurationPanel1.GetActiveContext;
If Pad Is IWorkbookValidationPadContext Then
SelectedElems := (Pad As IWorkbookValidationPadContext).SelectedElems;
For Each Desc In SelectedElems Do
Debug.WriteLine(Desc.Name + '(' + Desc.Id + ')');
End For;
End If;
End Sub Button1OnClick;
Clicking the button performs a control: whether the currently opened component tab is the tab with with validation rule tree. If the tab with validation rule tree is opened, the list of selected elements (names and identifiers) in the tree will be displayed only to the development environment console.
See also: