Form: IWebForm;
The Form property returns the repository web form displayed in the component.
The property enables the user to access the web form displayed in the component and interact with the form by sending commands.
Executing the example requires that the repository contains two web forms. The first web form contains the Button and the Frame components. Key of the second web form is set as a value of the mobj property for the Frame component. The second web form can contain any components, and the OnCommand event handler is set for the form, which code is given below.
// First form code
Class ONEWebForm: WebForm
Button1: WebButton;
Frame1: WebFrame;
Sub Button1OnClick;
Begin
Self.Text := Frame1.Form.SendCommand("command1");
End Sub Button1OnClick;
End Class ONEWebForm;
// Second form code
Class TWOWebForm: WebForm
Sub TWOWebFormOnCommand(Args: IWebCommandEventArgs);
Begin
If Args.Command = "command1" Then
Args.Result := "1";
Elseif args.Command = "command2" Then
Args.Result := "2";
Else
Args.Result := "0";
End If;
End Sub TWOWebFormOnCommand;
End Class TWOWebForm;
After starting the first web form the second form contents is displayed in the Frame component. Clicking the button sends a command to the second web form. The command execution result is displayed in the first web form title.
See also: