AYUDA EN LÍNEA
 WINDEVWEBDEV Y WINDEV MOBILE

Este contenido se ha traducido automáticamente.  Haga clic aquí  para ver la versión en inglés.
Ayuda / Desarrollar una aplicación o un sitio web / RAD / Modelo RAD
  • 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
WindowsLinuxJavaReportes y ConsultasCódigo de Usuario (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Código Navegador
WINDEV Mobile
AndroidWidget Android iPhone/iPadIOS WidgetApple WatchMac Catalyst
Otros
Procedimientos almacenados
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: 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 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 file table.
  • Buttons for basic actions: Add, Modify, Delete.
In the RAD pattern, only one relationship page needs to be created: it links RADFileB to RADFileD.
Example: Relationship page in the RAD Simple pattern:

Creating a relation page

To create a relation 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" and validate.
  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_Relation_RADFichierA, PAGE_Rel_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. The page must be divided into two sections:
    • a File section: in this section, the characteristics of the file RADFichierB will be displayed.
    • 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 on the page: under the "Creación" pane, in the "Contenedores" 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.
  2. 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). For example: SC_Fiche_RADFichierB.
  3. In the "Content" tab of the supercontrol description window, specify:
    • the data file browsed: RADFichierB.
    • the item browsed: RADFileBID.
  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 on the page: under the "Creación" pane, in the "Datos" group, pull down "Tabla" and select "Table".
  2. In the table creation wizard, specify the following characteristics:
    • Select the "Display data from a file or query" option.
    • 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.RADFileBID
    
    // 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 add button, it is advisable to activate automatic error handling (Option "If error: ", with automatic processing "Execute error handling ("ERROR CASE:" 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,RADFileBIDRel,RADFileB.RADFileBID)
    
    // The form section is read-only
    GR_PartieFiche..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)
Ver también
Versión mínima requerida
  • Versión 12
Comentarios
Haga clic en [Agregar] para publicar un comentario

Última modificación: 19/02/2025

Señalar un error o enviar una sugerencia | Ayuda local