Object: IMetabaseObject;
Object: Prognoz.Platform.Interop.Metabase.IMetabaseObject;
The Object property determines the repository object, which parameters are worked with in the component.
The object specified in this property must be opened in the edit mode. After changing the parameters list in the component, to save the changes call the Save method.
If the Object property is determined in the objects inspector, the object automatically opens in the edit mode on form launch.
Executing this example requires a form that contains two buttons named Button1 and Button2, and the MetabaseObjectParamsBox component named MetabaseObjectParamsBox1. The repository must also contain an object with the Report_1 identifier.
Class TESTForm: Form
MetabaseObjectParamsBox1: MetabaseObjectParamsBox;
Button1: Button;
Button2: Button;
Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
MB: IMetabase;
Begin
MB := MetabaseClass.Active;
MetabaseObjectParamsBox1.Object := MB.ItemById("Report_1").Edit;
End Sub Button1OnClick;
Sub Button2OnClick(Sender: Object; Args: IMouseEventArgs);
Begin
MetabaseObjectParamsBox1.Object.Save;
End Sub Button2OnClick;
End Class TESTForm;
On clicking Button1 the specified object is connected to the MetabaseObjectParamsBox component. After editing the parameter and clicking Button2, all parameters changes are saved.
Executing this example requires a .NET form that contains two buttons named Button1 and Button2, and the MetabaseObjectParamsBoxNet component named MetabaseObjectParamsBoxNet1. The repository must also contain an object with the Report_1 identifier.
Imports Prognoz.Platform.Forms.Net;
Imports Prognoz.Platform.Interop.Metabase;
Public Partial Class TESTForm: Prognoz.Platform.Forms.Net.ForeNetForm
Public Constructor TESTForm();
Begin
InitializeComponent();
End Constructor;
Private Sub button1_Click(sender: System.Object; e: System.EventArgs);
Var
MB: IMetabase;
Begin
MB := Self.Metabase;
metabaseObjectParamsBoxNet1.Object := MB.ItemById["Report_1"].Edit();
End Sub;
Private Sub button2_Click(sender: System.Object; e: System.EventArgs);
Begin
metabaseObjectParamsBoxNet1.Object.Save();
End Sub;
End Class;
On clicking Button1 the specified object is connected to the MetabaseObjectParamsBox component. After editing the parameter and clicking Button2, all parameters changes are saved.
See also: