Build master form

In this section you will create the page storing the form associated to the master table's list. This form performs both the insert and update operation for the company_com table, when the appropriate links are pressed in the list page.

To create the basic form, follow the next steps:

  1. Open the master_form file in Dreamweaver.

  2. Apply the NeXTensio Form Wizard form the MX Kollection tab of the Insert panel.

  3. In the first step of the wizard, select the table to use: company_com. The user interface persistence will take care of the rest, configuring the fields as you did for the list.

  4. Press the Finish button to exit the wizard and add all elements to the page.

  5. Save the page and upload it to the server. It does not require any kind of modification in order to work properly.

After you've created the basic form, you have to enhance it so that a company with associated contacts cannot be deleted. To create this enhancement, follow the next steps:

  1. Apply the Check Detail Record server behavior. You can access it from the Server Behavior tab > + > MX Kollection > Form Validation > Check Detail Record.

  2. Configure the dialog box's Basic tab.  The Transaction Table and Primary Key fields are disabled, because their values are retrieved from the delete transaction on page.

  3. In the Detail Table drop-down menu select the table that acts as detail for the transaction table. Select contact_con.

  4. In the Detail foreign key drop-down menu select the table column containing the association to the master table: idcom_con.

  5. In the Error message text area enter the message to display when the check fails.


     

  6. Click the OK button to apply the server behavior. If you attempt to delete a company that has associated contacts, the selected message will be displayed, and the transaction stopped: