ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

This content has been translated automatically.  Click here  to view the French version.
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 Form pages
  • Overview
  • To create a form page:
  • Case of print buttons
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
Creating the Form 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: The following files are required to implement a RAD pattern used to create a full project:
  • 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 provided with WEBDEV 16.
These rules are recommendations. You can implement and use your own standard.
The Form pages

Overview

A form page contains the following elements:
  • A supercontrol: This supercontrol contains the controls of the form to display. This supercontrol is linked to the file to display.
  • Buttons used to validate or to cancel (back button).
  • Vision Plus buttons used to select elements of another file in a specific page (for the forms regarding RADFileB and RADFileC only).
Note: If the pattern uses a menu, it is advisable to insert this menu into the page template used by the pattern.. Therefore, the menu will be accessible from all the generated pages.
Example of Form page for the Intranet pattern:

To create a form page:

  1. Click in the quick access buttons.
    • The window for creating a new element is displayed: click "Page" then "Page".
    • The page creation wizard opens.
    • Select "Blank". You can select the template used in your pattern.
  2. In the description window, enter the name of the page. This name must contain the name of the file displayed in the file (examples: PAGE_Fiche_RADFichierA, PAGE_Fic_RADFichierA, ...)..
    Note: If you want to specify the name of the current file to the user, use the name of the file (RADFileA for instance) in a caption. The RADFileX term will be automatically replaced with the caption of the file described in the analysis.
  3. Save the page.
  4. Create a supercontrol on the page: under the "Creation" pane, in the "Containers" group, click on "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.
  5. In the supercontrol description window, specify the name of the supercontrol. This name must be SC_Fiche (SC_ is the prefix of the programming guidelines: it is not necessary if you are not using programming guidelines).
  6. In the "Content" tab of the supercontrol description window, specify:
    • the data file browsed: RADFichierXX (e.g. "RADFichierA").
    • the item browsed: IDRADFileXX ("RADFileAID" for example).
  7. Create and position the various buttons on your page: validation button, back to previous page button, etc. These buttons can have any name.
  8. Case of validation button ("OK" or "Validate" button for example).
    In the validation button code, it is advisable to activate automatic error handling (Option "If Error: ", with automatic processing "Execute error handling ("ERROR CASE:" in code)").
    The code of the validation button can be (for a form on RADFileA):
    // Read the information entered 
    PageToFile()
    // If it's a new record
    IF RADFileA..NewRecord = True THEN 
    	// Add it
    	HAdd(RADFileA) 
    ELSE 
    	// Modify it 
    	HModify(RADFileA) 
    END
    // Back to the previous page
    IF PreviousPage() = "" THEN
    	PageDisplay(PreviousPage)
    ELSE
    	PageDisplay(PAGE_Home)
    END
    
    CASE ERROR:
    	Error("An error occurred during the validation.", HErrorInfo())
    	RETURN
  9. 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.
  10. Enter the initialization code of the page. Example:
    // Display the records 
    FileToPage()

    This code is used to display the value of the records in the form.
  11. Add the Vision Plus buttons if necessary (for the RADFileB and RADFileC forms).

Case of print buttons

A RAD pattern can contain buttons used to start a print. The code of these buttons must allow you to start the print 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 "Form" or "Table" in the name of the form to easily identify the type of the report.
  • This name must be used in the code of the print button:
    // Create a unique file name
    sFile is string = fDataDir() + "\" + DateSys() + TimeSys() + ".pdf"
    // Print the report in a PDF file
    iDestination(iPDF, sFile)
    // Generate the report
    iPrintReport(RPT_List_RADFileA)
    // Display the report in PDF format
    FileDisplay(sFile, "application/pdf")
    // Delete the file
    fDelete(sFile)
CAUTION: There is no need to customize the reports found in your project of RAD Pattern. Indeed, during the generation, only the name of the report will be kept. If the "Print" button is found in a "Form" page, the printed report will be a Form report. If the "Print" button is found in a "Table" page, the printed report will be a Table report.
Minimum version required
  • Version 12
Comments
Click [Add] to post a comment

Last update: 02/19/2025

Send a report | Local help