IWebDimensionTree.DimInstance

Syntax

DimInstance: IDimInstance;

Description

The DimInstance property returns the dictionary data that should be displayed in the component.

Example

Executing the example requires that the repository contains a dictionary with the DICT_1 identifier. There should also be a web form and the DimensionTree component named DimensionTree1 on the form. The specified procedure is set as a handler of the OnShow event for the web form.

Add links to the Dimensions and Metabase system assemblies.

Sub TESTWebFormOnShow;
Var
    Mb: IMetabase;
    Dim: IDimInstance;
    Sel: IDimSelection;
Begin
    Mb := MetabaseClass.Active;
    // Open dictionary
    Dim := Mb.ItemById("DICT_1").Open(NullAs IDimInstance;
    // Create selection
    Sel := Dim.CreateSelection;
    Sel.SelectElement(2False);
    Sel.SelectElement(4False);
    Sel.SelectElement(6False);
    // Connect dictionary to component
    DimensionTree1.DimInstance := Dim;
    DimensionTree1.Selection := Sel;
End Sub TESTWebFormOnShow;

When the web form is started, the specified dictionary is connected to the DimensionTree1 component. Three elements will be selected.

See also:

IWebDimensionTree