CollectValues(bSet: Boolean; Values: IMetabaseObjectParamValues): Boolean;
bSet is a parameter that determines the action that occurs if the method is activated. If the passed value is True, the values from the Values collection are assigned to the current control elements when activating the method. If the passed value is False, the values taken from the appropriate control elements are put into the Values values collection.
Values is a collection of the parameters values.
The CollectValues method performs the operation with values of the parameters that are determined by the bSet parameter, and returns the operation execution result..
Executing the example requires a form with the Button1 button, the UiMetabaseObjectParams component named UiMetabaseObjectParams1, the component, to which the repository object is connected and parameters of which are controlled by UiMetabaseObjectParams1 and the components used to control parameters values. Object parameters have the numerical values.
Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
UIObj: IUiMetabaseObject;
Obj: IMetabaseObjectDescriptor;
ParamValues: IMetabaseObjectParamValues;
ParamValue: IMetabaseObjectParamValue;
Begin
UIObj := UiMetabaseObjectParams1.UiObject;
Obj := UIObj.Object;
ParamValues := Obj.Params.CreateEmptyValues;
UiMetabaseObjectParams1.CollectValues(False, ParamValues);
For Each ParamValue In ParamValues Do
ParamValue.Value := ParamValue.Value + 1;
End For;
UiMetabaseObjectParams1.CollectValues(True, ParamValues);
UIObj.Active := False;
UIObj.Active := True;
End Sub Button1OnClick;
If the user presses the button after executing this example, the collection of parameters values assigned in the control elements is received. All values are increased by one. The control elements are updated after that and the object is reopened with new values of the parameters.
See also: