Child pages
  • Placing Forms Within a Form
Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 8 Next »

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).

Placing a Form within a Form

To place a form in another form, we need the following Servoy objects

  • A relation
  • Another form
  • A tabpanel
Creating a Relation

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:

  1. Do one of the following
    1. Select File>New>Other. A window with a tree view will appear. Select Servoy>New Relations. A new window will appear; select the solution to place the relation and give the relation a name.
    2. Select the dropdown on the New button on the Developer toolbar and select Other. A window with a tree view will appear. Select Servoy>New Relations. A new window will appear; select the solution to place the relation and give the relation a name.
    3. Select the Relations node in the Solution Explorer under the desired solution. Click the Create relation button in the Solution Explorer list view toolbar.
    4. 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.

  2. A new relation editor view should appear in the middle of Servoy Workbench. Do not edit the name at this time.
  3. Select the table for the left side of the relation by clicking on the ... button. For this example, select example_data.customers.
  4. Select the table for the right side of the relation by clicking on the ... button. For this example, select example_data.customers.
  5. The name of the relation has been constructed automatically in the name field after selecting the tables.  This name must be unique, so verify that the name is sufficient for the relation and editing is not required. For this example, the default should be fine.
  6. 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.

  7. Set the constraints for the relationship. For this example, leave them as they are by default.
  8. Save the relation editor. See Intro to Servoy Developer environment
Creating a Form

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

  • Add data providers with the Fill text property and Place horizontal options selected.
  • Ensure the form is in Table View by checking the form property view and that is it set to Table view (locked).
Creating a Tabpanel

A tabpanel is a Servoy control/object that can be placed on a form.  See Intro to Servoy Concepts for more information about tabpanels.

To place a tabpanel on a form:

  1. Make sure the desired form is open in Form Designer and selected
  2. Do one of the following
    1.  
  • No labels