Copyright © TIBCO Software Inc. All Rights Reserved
Copyright © TIBCO Software Inc. All Rights Reserved


Chapter 3 Tasks : Using Embedded Forms

Using Embedded Forms
The Embedded Forms feature enables you to embed one form within another. You can use this design technique to create smaller reusable fragments of a form separately, which can then be embedded in a parent form.
Embeddable Form A form that has been designed to be embedded is referred to as an embeddable form.
Embedded Form Once a form is embedded within the parent form, it is referred to as an embedded form.
For example: you have to design a form for delivery of goods to customers. In such a form, different types of address information is required, such as delivery address and personal address. If you design a normal form, you have to create the same set of address fields at two places. By using the embedded forms feature, you can create a reusable embeddable form with the address fields and embed this form at multiple locations in the parent form.
Prerequisites of an Embeddable Form
An embeddable form has no navigation or message panes, as navigation and messaging are taken care of by the parent form.
If you want to embed an existing form within another form, it is advisable to make the following changes to make the existing form suitable for embedding:
Working with Embedded Forms
This section describes the creation of embeddable forms and different gestures for embedding a form.
To Create an Embeddable Form
Perform the following steps to create an embeddable form from the Project Explorer:
1.
Go to the Forms folder, or any folder under the Forms folder in the Project Explorer and click Context Menu > New > Form. The New Form dialog opens.
2.
On the New Form dialog box, specify the File name. Select the Form type as Embeddable.
3.
This newly created form will only have a single root pane. Messages and navigation panes are not created.
To Embed a Form by Using the Embedded Form Icon
1.
Figure 106 Using the Embedded Form Icon
2.
The Select the form to embed dialog is displayed. All the forms available in all the projects in the workspace are listed in the dialog. Select the required form.
3.
The Embedded Form dialog appears asking you to map the embedded form parameters in the ‘Mapping’ property section. Click Yes to continue or No to skip the parameter binding. See Working with Embedded Form Parameters for the details of parameter binding.
To Embed a Form from the Project Explorer
You can embed any form within the project or any project on which the existing project depends.
Perform the following steps to embed a form from Project Explorer:
1.
2.
Figure 107 Embedded Form Inserted in a Parent Form
 
To Add a BOM Class or Form Parameter to a Form
You can create an embeddable form UI components directly from a BOM class. Select a BOM class in the Project Explorer and drop it in the Form Designer canvas. All the UI components associated with the BOM class are automatically created on the form.
Similarly, you can select a form parameter in the Outline view and drop it in the Form Designer canvas. This will also automatically create all the UI components associated with the parameter.
Working with Embedded Form Parameters
Once a form is embedded within a parent form, the embedded form parameters can be accessed only via the parent form. An embedded form exposes an interface that consists of its parameters. The panes and controls in an embedded form are generally bound or otherwise mapped to its parameters. These parameters in the embedded form are in turn mapped to parameters, data fields, controls, or panes in the parent form.
For example: we have an embeddable form which contains a single pane that is bound to a parameter of particular type defined as a BOM class. This form is embedded in a parent form. You bind an embedded form parameter to one of the parent form’s IN OUT parameters of the same type. When the parent form is loaded with an instance of that parameter, the embedded form is updated via the binding. This is one of the mechanisms by which information is exchanged between the parent form and the embedded form
There are many ways in which data can be exchanged between the parent and the embedded forms:
1.
2.
3.
For details of how to set bindings and actions, see Working with Bindings, Actions, and Rules.
Accessing Embedded Form Parameters
You can access the embedded form parameters using action scripts and computation actions.
The parameters of the embedded form appear as Data Fields in the deployed copy of the parent form. The names of these parameters are scoped by the name of the embedded form.
Example:
data.get<EmbeddedFormName>_<ParamName>();
For example, data.getCustomerForm_Customer();
Set Bindings from the Mappings Tab
To set the bindings from the Mapping tab, perform the following steps:
1.
2.
Go to the Mappings tab in the Properties view of the parent form.
3.
4.
Figure 108 Set Binding Using the Mappings Tab
Rendering of Embedded Forms
On the Form Designer canvas, an embedded form is represented as a pane containing a form icon. When the builder runs, it creates a deployable copy of the parent form. Each embedded form pane is replaced by the contents of its respective embeddable form, recursively.
At preview and runtime, the GWT implementation renders the deployable copy of the parent form.
Figure 109 Preview Rendering of the Parent Form
 
Editing Embedded Forms
You cannot directly edit an embedded form within the context of the parent form. It is possible to move it to a different location within the form, but it cannot be edited directly.
To edit the embedded form, perform the following steps:
1.
2.
Go to the Properties tab in the Properties view of the embedded form pane. The Form Reference displays a link to the embedded form.
 
Figure 110 Properties Tab for the Embedded Form
3.
4.
5.
The updates are available in the parent forms without having to re-embed the form.

Copyright © TIBCO Software Inc. All Rights Reserved
Copyright © TIBCO Software Inc. All Rights Reserved