IRdsDictionaryInstance.Data

Syntax

Data(Element: Integer): IRdsDictionaryElementData;

Parameters

Element. Element key, which data should be received.

Description

The Data method returns data of the element, which key is passed by the Element parameter.

Example

Executing the example requires a form with the Button1 button, the RdsDictionaryBox component named RdsDictionaryBox1, and the UiRdsDictionary component that is a data source for RdsDictionaryBox1.

Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);

Var

DictInst: IRdsDictionaryInstance;

ElemData: IRdsDictionaryElementData;

Attrs: IRdsAttributesInstance;

Attr: IRdsAttributeInstance;

i: Integer;

Begin

i := RdsDictionaryBox1.FocusedElement;

If i = -2 Then

Debug.WriteLine(Dictionary root element that does not have definite attributes values is selected);

Elseif i = -1 Then

Debug.WriteLine(None of dictionary element is selected);

Else

DictInst := RdsDictionaryBox1.Source.Instance;

ElemData := DictInst.Data(i);

Attrs := DictInst.Attributes;

For Each Attr In Attrs Do

Debug.Write(Attribute: + Attr.Name);

Debug.WriteLine(; Value: + ElemData.Attribute(Attr.Key));

End For;

End If;

End Sub Button1OnClick;

After executing the example while pressing the button information about dictionary element focused in the RdsDictionaryBox1 component is displayed in the development environment console.

See also:

IRdsDictionaryInstance