ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / Developing an application or website / RAD / RAD pattern
  • The steps for creating a RAD pattern
  • Creating the different pattern windows
  • The files to create
  • Difference between Mobile and Smartphone
  • Standard to follow
  • The Table windows for Mobile
  • Ccreating a table window for Mobile
  • Case of print buttons
  • The Table windows for Smartphone
  • To create a table window for Smartphone:
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 Table windows of the WINDEV Mobile RAD pattern
The steps for creating a RAD pattern
The steps for creating a WINDEV Mobile RAD pattern are as follows:
  1. Creating the "RAD Pattern" project.
  2. Creating the different pattern windows.
  3. Generating the RAD pattern.
  4. Using the RAD pattern.
Creating the different pattern windows

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 relation window RADFileB/RADFileD.
These different elements must contain link buttons. You also have the ability to provide the main menu of the application.

Difference between Mobile and Smartphone

Creating an application for Mobile and an application for Smartphone are two different things. On a Smartphone, the screen is smaller and a drop-down menu allows you to validate (or not) the screens.
This difference also applies to the RAD patterns. This help page explains how to create a form window for Mobile and for Smartphone.

Standard to follow

This help page presents the different rules that must be applied when creating the pages and windows of the RAD pattern. These rules have been used to create the different patterns supplied with WINDEV Mobile 27.
These rules are recommendations. You can implement and use your own standard.
The Table windows for Mobile
A Table window contains the following elements:
  • A Table control: This table is a browsing table, with direct access file.
  • Buttons used to perform the main actions: "Add", "Modify", "Delete" and "Print" if necessary.
  • Link options used to display the corresponding forms for example.
Example: Table window on RADFileA of the Simple Template pattern:

Ccreating a table window for Mobile

To create a table window for Mobile:
  1. Click among the quick access buttons:
    • The element creation window appears: click "Window" then "Window".
    • The window creation wizard starts.
    • Select "Wizard".
    • In the wizard, keep the default options.
  2. In the description window, enter the following information:
    • The window name. This name must necessarily contain the name of the file displayed in the table (some examples: WIN_Table_RADFileA, WIN_Tab_RADFileA, ...).
    • The window title. If the title must display the name of the file, use the name of the "RADFileXX" file (for example, "RADFileA: Viewing table").
  3. Save the window.
  4. Create a Table control in the window: on the "Creation" pane, in the "Data" group, expand "Table and List Box" and select "Table (Vertical)".
  5. In the table creation wizard, specify the following characteristics:
    • Select "Display the data found in a file or in an existing query".
    • Select the base file of the table (RADFileA for example).
    • Keep the proposed item as well as the search item.
    • Specify the source for the fill operation: "File with direct access (no limit)".
    • Validate the name of the table.
  6. Position the Table control in the window and define its size. The column corresponding to the identifier can be invisible if necessary.
  7. Create and position the different buttons of your window (validation, print, browse, ...). These buttons can have any name.
    Caution: if the user is allowed to apply a skin template to the windows created by RAD, you must define the type of button that must be used in the skin template. This information can be defined in the modifier ("Skin template" category).
  8. Case of addition button (New button for example).
    This button can be used to enter a new record in a form window for example. The code of the New button can be:
    // Create a new record
    HReset(RADFileA)
    // Open the form of RADFileA in creation mode
    Open(WIN_Form_RADFileA)
    // Refresh the table
    TableDisplay(TABLE_RADFileA, taCurrentRecord)
  9. Case of modification button (Modify button for example).
    This button can be used to modify a record in a form window. The code of the Modify button can be:
    // Is a row selected?
    IF TableSelect(TABLE_RADFileA) = -1 THEN RETURN
    // Open the form of RADFileA in modification mode
    Open(WIN_Form_RADFileA)
    // Refresh the table
    TableDisplay(TABLE_RADFileA, taCurrentRecord)
  10. Case of deletion button (Delete button for example).
    This button can be used to delete a selected record from the table for example.
    The code of the Delete button can be (for the table on RADFileA):
    // Is a row selected?
    IF TableSelect(TABLE_RADFileA) = -1 THEN RETURN

    // Asks to confirm the deletion
    SWITCH YesNo("Do you want to delete the record?")
    CASE Yes
      // Delete the RADFileA record from the table
      TableDelete(TABLE_RADFileA)
      // Position on the current record
      TableDisplay(TABLE_RADFileA, taCurrentRecord)
     CASE No
    // No action
    END

    In the code of the deletion button, we advise you to enable the automatic management of errors ("If Error: ", with the automatic process "Display the error and go back to edit").
  11. Add the link menus if necessary.
  12. Add the Vision Plus buttons if necessary.

Case of print buttons

A RAD pattern can contain buttons used to start a print. The code of these buttons (or the associated preset option) must allow you to start the printing of the report.
The reports must be created in the project of the RAD pattern:
  • The name of these reports must contain RADFileX. For better readability, we recommend that you use "Details" in the name of form reports and "List" in the name of table reports.
  • This name must be used in the code of print button (or in the preset action associated with the button).
CAUTION: There is no need to customize the reports found in your project of the RAD pattern. Indeed, during the generation, only the name of the report will be kept. If the "Print" button is found in a "Form" window, the printed report will be a Form report. If the "Print" button is found in a "Table" window, the printed report will be a Table report.
The Table windows for Smartphone
A Table window contains the following elements:
  • A table: This table is a browsing table, with direct access file.
  • Menu options used to perform the main actions: Add, Modify and Delete.
  • Link menu options used to display the corresponding forms for example.
Example: Table window on RADFileA of the Simple Template pattern:

To create a table window for Smartphone:

  1. Click among the quick access buttons.
    • The element creation window appears: click "Window" then "Window".
    • The window creation wizard starts.
    • Select "Wizard".
    • In the wizard, keep the default options.
  2. In the description window, enter the following information:
    • The window name. This name must necessarily contain the name of the file displayed in the table (some examples: WIN_Table_RADFileA, WIN_Tab_RADFileA, ...).
    • The window title. If the title must display the name of the file, use the name of the "RADFileXX" file (for example, "RADFileA: Viewing table").
  3. Save the window.
  4. Create a Table control in the window: on the "Creation" pane, in the "Data" group, expand "Table and List Box" and select "Table (Vertical)".
  5. In the table creation wizard, specify the following characteristics:
    • Select "Display the data found in a file or in an existing query".
    • Select the base file of the table (RADFileA for example).
    • Keep the proposed item as well as the search item.
    • Specify the source for the fill operation: "File with direct access (no limit)".
    • Validate the name of the table.
  6. Position the Table control in the window and define its size. The column corresponding to the identifier can be invisible if necessary.
  7. Modify the menu found in the window:
    • Menu options must allow you to add, modify or delete an element.
    • A menu option must allow you to access the linked file (to access RADFileB from the RADFileA table for example).
    • A menu option must allow you to close the window.
  8. The menu options must have specific names:
  9. Case of the addition option.
    This option can allow you to enter a new record in a form window for example. The code of the New option can be:
    // Create a new record
    HReset(RADFileA)
    // Open the form of RADFileA in creation mode
    Open(WIN_Form_RADFileA)
    // Refresh the table
    TableDisplay(TABLE_RADFileA, taCurrentFirst)
  10. Case of the modification option.
    This option can allow you to modify a record in a form window for instance. The code of the Modify option can be:
    // Is a row selected?
    IF TableSelect(TABLE_RADFileA)=-1 THEN RETURN
    // Open the form of RADFileA in modification mode
    Open(WIN_Form_RADFileA)
    // Refresh the table
    TableDisplay(TABLE_RADFileA, taCurrentSelection)
  11. Case of deletion option.
    This option can allow you to delete a record selected in the table. The code of the Delete option can be (for the table on the RADFileA file):
    // Asks to confirm the deletion
    SWITCH YesNo("Do you want to delete the record?")
            CASE Yes
              // Delete the RADFileA record from the table
              TableDelete(TABLE_RADFileA)
              // Position on the current record
              TableDisplay(TABLE_RADFileA, taCurrentFirst)
             CASE No
                    // No action
    END

    In the code of the deletion button, we advise you to enable the automatic management of errors ("If Error: ", with the automatic process "Display the error and go back to edit").
  12. Case of link options:
    • From the RADFileA table, you can have a link option used to display the RADFileB table for example.
    • From the RADFileB table, you can have a link option used to display the RADFileA table, the RADFileC table and the relation window for example.
Example of code used to open the RADFileB table window from the RADFileA table window:
// Implement the filter on the link key
HFilter(RADFileB, IDRADFileARel, RADFileA.IDRADFileA)
// Open the table window of RADFileB
Open(WIN_Table_RADFileB)
// Disable filter
HDeactivateFilter(RADFileB)
Minimum version required
  • Version 12
Comments
Click [Add] to post a comment

Last update: 09/07/2021

Send a report | Local help