Forms may be placed within other forms by placing a tabpanel on a form. A tabpanel can show other forms with the solution (including forms from other modules).
To place a form in another form, we need the following Servoy objects
Before we can place a related form on another form, we must create a Relation. A relation is a link between to tables (or a global variable and a table)
For this example, we will create a relation in the 'example_data' database from customers to orders.
To create a relation:
Right click on the Relations node in the Solution Explorer under the desired solution. Select Create relation from the menu.
TIP
The last two options are more desirable as they will allow Servoy Developer to name the relation for you.
Select the primary key of the parent(left) table and the matching foreign key of the child(right) table. For this example, ensure the customer_id equals the customer_id.
NOTE
Servoy Developer will normally try to match these ids if they have the same name and it is a true primary key to foreign key match.
Before a form can be placed onto another form, the form must be created. You cannot create new forms in the same editor; each form opens in its own editor. For information about creating a form, please see Creating Forms.
For this example, create a new form based on 'example_data.orders' table. Make the form a table view form.
To create a table view form, use the same instructions on Creating Forms, with the following exceptions
A tabpanel is a Servoy control/object that can be placed on a form. See Intro to Servoy Concepts for more information about tabpanels. For this example, we will place the newly created orders form on the customers detail form.
To place a tabpanel on a form:
The customers form should now show the orders form within the tabpanel. Since the form was added through a relation, the data in the orders form are related records to the selected customer. If the customer record is navigated, the records in the order form will also reload to the related records for currently selected customer record.
1 Comment
Anonymous
Creating a Relation. Step 4 is incorrect it should be (I think) For this example, select example_data.order