IWebDimensionCombo.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 DimensionCombo component named DimensionCombo1 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
    DimensionCombo1.DimInstance := Dim;
    DimensionCombo1.Selection := Sel;
End Sub TESTWebFormOnShow;

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

See also:

IWebDimensionCombo