IRdsParamsControlInstance.Data

Fore Syntax

Data: IRdsDictionaryElementData;

Fore.NET Syntax

Data: Prognoz.Platform.Interop.Rds.IRdsDictionaryElementData;

Description

The Data property returns data of dictionary attributes, which values are taken as values for parameters of a linked dictionary.

Fore Example

Executing the example requires a form with the btnPData button, and an MDM repository with the NSI_1 identifier that contains an MDM dictionary with the MAINDICT identifier. The dictionary has an attribute with the PARAM_ATTR identifier that is used to control parameters of the linked dictionary. Add links to the Metabase, Rds and Forms system assemblies.

The example is a handler of the OnClick event for the button.

Sub btnPDataOnClick(Sender: Object; Args: IMouseEventArgs);
Var
    Mb: IMetabase;
    Dict: IRdsDictionary;
    DictInst: IRdsDictionaryInstance;
    ElData: IRdsDictionaryElementData;
    iAttrKey: Integer;
Begin
    Mb := MetabaseClass.Active;
    Dict := Mb.ItemByIdNamespace("MAINDICT", Mb.GetObjectKeyById("NSI_1")).Bind As IRdsDictionary;
    iAttrKey := Dict.Attributes.FindById("PARAM_ATTR").Key;
    DictInst := Dict.Open(Null);
    ElData := DictInst.CreateElementData;
    ElData.Attribute(iAttrKey) := 0;
    Text := DictInst.Links.Item(0).ParamsControl(ElData).Data.Attribute(iAttrKey) As String;
End Sub btnPDataOnClick;

After executing the example, the form title displays element value by attribute that controls parameter values of the linked dictionary, which key is passed using the iAttrKey parameter.

Fore.NET Example

Executing the example requires a form with the btnPData button, and an MDM repository with the NSI_1 identifier that contains an MDM dictionary with the MAINDICT identifier. The dictionary has an attribute with the PARAM_ATTR identifier that is used to control parameters of the linked dictionary. Add a link to the Rds system assembly.

The example is a handler of the Click event for the button.

Imports Prognoz.Platform.Forms.Net;
Imports Prognoz.Platform.Interop.Metabase;
Imports Prognoz.Platform.Interop.Rds;

...

Private Sub btnPData_Click(sender: System.Object; e: System.EventArgs);
Var
    Mb: IMetabase;
    Dict: IRdsDictionary;
    DictInst: IRdsDictionaryInstance;
    ElData: IRdsDictionaryElementData;
    iAttrKey: uinteger;
Begin
    Mb := Self.Metabase;
    Dict := Mb.ItemByIdNamespace[
"MAINDICT", Mb.GetObjectKeyById("NSI_1")].Bind() As IRdsDictionary;
    iAttrKey := Dict.Attributes.FindById(
"PARAM_ATTR").Key;
    DictInst := Dict.Open(
Null);
    ElData := DictInst.CreateElementData();
    ElData.Attribute[iAttrKey] := 
0;
    Text := DictInst.Links.Item[
0].ParamsControl[ElData].Data.Attribute[iAttrKey].toString();
End Sub;

After executing the example, the form title displays element value by attribute that controls parameter values of the linked dictionary, which key is passed using the iAttrKey parameter.

See also:

IRdsParamsControlInstance