ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / Developing an application or website / RAD / RAD pattern
  • The steps for creating a RAD pattern
  • Which pages must be created?
  • The files to create
  • Standard to follow
  • The relation pages
  • Overview
  • Creating a relation page
  • Creating the Form section
  • Creating the Table section
  • Creating buttons
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
Creating the Relation pages of a WEBDEV RAD pattern
The steps for creating a RAD pattern
The different steps for creating a WEBDEV RAD pattern are as follows:
  1. Creating the "RAD Pattern" project.
  2. Creating the different pages of the pattern.
  3. Generating the RAD pattern.
  4. Using the RAD pattern.
Which pages must be created?

The files to create

Reminder: To build a RAD pattern used to create a full project, the following files are required:
  • A form for RADFileA.
  • A form for RADFileB. A Vision Plus button (or a popup combo box) must allow you to select an element of RADFileA.
  • A form for RADFileC. A Vision Plus button (or a popup combo box) must allow you to select an element of RADFileB.
  • A table for RADFileA.
  • A table for RADFileB.
  • A table for RADFileC.
  • A RADFileB/RADFileD relation page.
The main menu of the site can be included in the template associated with the pages.

Standard to follow

This help page presents the rules that apply when creating the pages of the RAD Pattern. These rules have been used to create the different patterns supplied with WEBDEV 16.
These rules are recommendations. You can implement and use your own standard.
The relation pages

Overview

The relation pages are used to simultaneously display information coming from several files. In a simple example, this type of page would be used to display the orders and corresponding order lines. This type of page can be Form + Table.
A Form + Table page groups the elements of the forms and the elements of the tables.
The form includes the following elements:
  • A supercontrol: This supercontrol contains the controls of the form to display. This supercontrol is linked to the file to display.
  • Back and Validate buttons.
The table includes the following elements:
  • A table: This table is a browsing table.
  • Buttons used to perform the main actions: Add, Modify, Delete.
A single relation page must be created in the RAD pattern: it links RADFileB to RADFileD.
Example: Relation page in the simple RAD pattern:

Creating a relation page

To create a relation page:
  1. Click in the quick access buttons.
    • The creation window appears: click "Page" then "Page".
    • The page creation wizard starts.
    • Select "Blank" and validate.
  2. In the description window, enter the name of the page. This name must necessarily contain the name of the file displayed in the form (some examples: PAGE_Relation_RADFileA, PAGE_Rel_RADFileA, ...).
    Remark: If you want to indicate the name of the current file to the user, use the name of the file (RADFileA for example) in a caption. The RADFileX term will be automatically replaced by the caption of the file described in the analysis.
  3. Save the page.
  4. The page must be divided into two sections:
    • a Form section: the characteristics of the form on RADFileB will be displayed in this section.
    • a Table section: the characteristics of the table on RADFileD will be displayed in this section. Buttons are used to manage the records found in the table.

Creating the Form section

To create the Form section:
  1. Create a supercontrol in the page: on the "Creation" tab, in the "Containers" group, click "Supercontrol". This supercontrol will display the controls found in the form. Position this control in the page and define its size. Scrollbars will be automatically displayed if some of the controls cannot fit in the specified size.
  2. In the supercontrol description window, specify the name of the supercontrol. This name must be SC_Form_ (SC_ is the prefix defined in the code style: it is not required if no code style is used). For example: SC_Form_RADFileB.
  3. In the "Content" tab of the supercontrol description window, specify:
    • the file browsed: RADFileB.
    • the item browsed: IDRADFileB.
  4. Assign the supercontrol to a group ("Groups ..." button in the "Details" tab of the supercontrol description). This group allows you to switch the form controls to display mode in the initialization code of the page. This group can be named "GR_FormSection" for example.

Creating the Table section

To create the Table section:
  1. Create a Table control in the page: on the "Creation" tab, in the "Data" group, expand "Table" and select "Table".
  2. In the table creation wizard, specify the following characteristics:
    • Select "Display the data from a file or from a query".
    • Select the base file of the table: RADFileD.
    • Keep the proposed items. The search key is IDLinkedRADFileB.
    • Validate the name of the table.
  3. Position the Table control in the page and define its size. The columns corresponding to the identifiers can be invisible if necessary.

Creating buttons

To create the different buttons:
  1. Create and position the buttons used to manage the records displayed in the table. These buttons can have any name.
    We advise you to include:
    • a button for adding a row,
    • a button for deleting a row,
    • a button used to validate and to go back to the previous page.
  2. Case of addition button ("Add a row" button for example).
    This button can be used to add a record into the table. The code of the Add button can be:
    // Initialize the new record
    HReset(RADFileD)
     
    // Assign the identifier of RADFileB
    // in the corresponding item of RADFileD file
    RADFileD.IDLinkedRADFileB = RADFileB.IDRADFileB
     
    // Add the record
    HAdd(RADFileD)
     
    // Update the table
    TableDisplay(TABLE_RADFileD)
     
    CASE ERROR:
    Error("An error occurred during the addition.", HErrorInfo())
    RETURN

    In the code of the addition button, we advise you to enable the automatic management of errors ("If Error: ", with the automatic process "Run the error process ("CASE ERROR:" in the code)").
  3. Case of deletion button ("Delete a row" button for example).
    This button can be used to delete a selected record from the table for example.
    The code of Delete button can be:
    // If the deletion is confirmed, delete the table row and
    // the corresponding record from the RADFileD file
    IF YesNo("Do you want to delete the record?") THEN
    // Delete the record from the table
     TableDelete(TABLE_RADFileD)
    // Position on the current record
     TableDisplay(TABLE_RADFileD, taCurrentFirst)
    END
     
    CASE ERROR:
     Error("An error occurred during the deletion.", HErrorInfo())
     RETURN

    In the code of the deletion button, we advise you to enable the automatic management of errors ("If Error: ", with the automatic process "Run the error process ("CASE ERROR:" in the code)").
  4. Case of return button ("Back" button for example).
    // Are we coming from a page?
    IF PreviousPage() = "" THEN
    // Yes, display this page
    PageDisplay(PreviousPage())
    ELSE
    // No, go back to the home page
    PageDisplay(PAGE_Home)
    END

    Remark: This code requires the presence of a page named "PAGE_Home" in the RAD pattern. This page can be the home page of the site and it can contain the main menu of the site. For more details, see Menu page.
  5. Enter the declaration code of the global variables of the page. Example:
    // Display the records
    FileToPage()
     
    // Filter for the table of RADFileD
    HFilter(RADFileD,IDRADFileBRel,RADFileB.IDRADFileB)
     
    // The form section is read-only
    GR_FormSection..State = DisplayOnly

    This code is used to:
    • display the value of the records in the form and in the table
    • switch the controls found in the form to "Read-only" mode.
  6. Enter the closing code of the page. This code is used to disable the filter:
    // Disables the filter
    HDeactivateFilter(RADFileD)
Minimum version required
  • Version 12
Comments
Click [Add] to post a comment

Last update: 05/26/2022

Send a report | Local help