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
  • Creating the different pattern windows
  • The files to create
  • Standard to follow
  • The relation windows
  • Overview
  • Creating a relation window
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 windows of a WINDEV RAD pattern
The steps for creating a RAD pattern
The steps for creating a WINDEV 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: 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 relation window RADFileB/RADFileD.
These different elements must contain link buttons. You also have the ability to provide the main menu of the application.

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 provided with WINDEV 2025.
These rules are recommendations. You can implement and use your own standard.
The relation windows

Overview

The relation windows are used to simultaneously display the information coming from several files. In a simple example, this type of window would be used to display the orders and the corresponding order lines. This type of window can be a Form + Table window.
A Form + Table window 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.
  • A combo box and a Vision Plus button
  • Buttons (if necessary) used to perform the main actions.
The table includes the following elements:
  • A table: This table is a table based on a data file, with file loaded in memory.
  • Buttons used to perform the main actions: Add, Modify, Delete and Print if necessary.
  • Link buttons used to display the corresponding forms for example.
In the RAD pattern, a relationship window must be created: it links RADFileB to RADFileD.
Example: Relation window in the RAD Simple pattern:

Creating a relation window

To create a relation window:
  1. Click in the quick access buttons:
    • When the new element window appears, click "Window" then "Window".
    • The window creation wizard opens.
    • In the wizard, select "Blank" and validate.
  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 form (some examples: WIN_Relation_RADFileD, WIN_Rel_RADFileD, ...).
    • The window title. If the title must display the name of the file, use the name of the "RADFileXX" file ("RADFileD: Relation" for example).
  3. Save the window.
  4. The window must be divided in 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:
  1. Create a supercontrol in the window: 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 window 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).
  3. In the "Content" tab of the supercontrol description window, specify:
    • the data file browsed: RADFichierB.
    • the item browsed: RADFileBID.
Creating the Table section:
  1. Create a Table control in the window: under the "Creación" pane, in the "Datos" group, pull down "Tabla y List Box" and select "Table (Vertical)".
  2. In the table creation wizard, specify the following characteristics:
    • Select "Display data from a data file or existing query".
    • Select the base file of the table: RADFileD.
    • Keep the proposed items. The search key is IDLinkedRADFileB.
    • Indicate source for filling: "File loaded in memory".
    • Validate the name of the table.
  3. Position the Table control in the window and define its size. The columns corresponding to the identifiers can be invisible if necessary.
  4. 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 delete button,
    • a button used to access the form of RADFileC,
    • a button for validating the window,
    • a cancel button.
    • link buttons.
      Caution: if you allow the user to apply a skin template to the windows created by RAD, you must define the type of button that must be used by the skin template. This information can be defined in the modifier ("Skin template" category).
  5. 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 Delete button can be:
    // Delete the current record
    TableDelete(TABLE_RADFileD)

    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 resume the input").
  6. Case of button to RADFileC (link button BTN_FormLink_RADFileC for example).
    This button can be used to view in a form a record selected in the table for example.
    The button code can be:
    // Find RADFileC for the current RADFileD
    HReadSeekFirst(RADFileC, RADFileCID, RADFileD.RADFileCIDRel)
    // If RADFileC does not exist
    IF HFound(RADFileC) = False THEN
    	// Message indicating that there is no RADFileC record
    	// linked to the current RADFileD record
    	Info("No RADFileC record linked to the current record.")
    	RETURN
    END
    // Open the form window of RADFileC
    Open(WIN_Form_RADFileC)

    Note: default link buttons are also required. For more details, see Creating the link buttons.
  7. Case of closing button (Validate button for example).
    This button is used to validate and close the window. To simplify things, you have the ability to use a preset action. We recommend that you use the "Close the window and return a value" action, with "Returned value: the value specified in the code by ..ReturnedValue".
    The code of this button is for example:
    // Check controls
    IF TABLE_RADFileD..Count = 0 THEN
    	Error("RADFileD must be typed")
    	RETURN
    END
    // Update the HFSQL context
    ScreenToFile()
    // Add or modify RADFileB
    IF RADFileB..NewRecord = True THEN
    	HAdd(RADFileB)
    ELSE
    	HModify(RADFileB)
    END
    // RADFileB was added
    // Add the corresponding RADFileD
    FOR EACH ROW OF TABLE_RADFileD
    	// Assign the identifier of RADFileB 
    	// to the columns of the table of RADFileD 
    	TABLE_RADFileD.COL_RADFileBIDRel = RADFileB.RADFileBID 
    	// Save the table
    	TableSave(TABLE_RADFileD) 
    END
    // Return value
    MyWindow..ReturnedValue = True
  8. Case of cancellation button:
    This button is used to cancel and close the window. To simplify things, you have the ability to use a preset action. We recommend that you use the "Close the window and return a value" action, with "Returned value: the value specified in the code by ..ReturnedValue".
    The code of this button can be for example:
    // If a creation is in progress, ask for confirmation
    IF RADFileB..NewRecord THEN
    	//1: &Save
    	//2: &Don't save
    	//3: Cancel
    	SWITCH Dialog("A record is currently created.")
    		//1: &Save
    		CASE 1: 
    		// Runs the click code of the validate button: 
    		// save the current data
    		ExecuteProcess(BTN_Validate, trtClick)
    		//2: &Don't save
    		CASE 2 // The window will be closed without backup
    		//3: C&ancel
    		CASE 3: RETURN
    	END
    END
  9. Initialization code of the window:
    // Display the records
    FileToScreen()
    // Filter for the table of FileD
    HFilter(RADFileD, RADFileBRelID, RADFileB.RADFileBID)
    // Default return value
    MyWindow..ReturnedValue = False
  10. Window closing code. This code is used to disable the filter:
    // Disables the filter
    HDeactivateFilter(RADFileD)
Ver también
Versión mínima requerida
  • Versión 12
Esta página también está disponible para…
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