|
|
|
|
|
- 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
Creating the Relation windows of a WINDEV RAD pattern
The steps for creating a 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. 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: - 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.
- 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).
- Save the window.
- 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: - 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. - 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).
- In the "Content" tab of the supercontrol description window, specify:
- the data file browsed: RADFichierB.
- the item browsed: RADFileBID.
Creating the Table section: - 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)".
- 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.
- Position the Table control in the window and define its size. The columns corresponding to the identifiers can be invisible if necessary.
- 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).
- 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"). - 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:
HReadSeekFirst(RADFileC, RADFileCID, RADFileD.RADFileCIDRel)
IF HFound(RADFileC) = False THEN
Info("No RADFileC record linked to the current record.")
RETURN
END
Open(WIN_Form_RADFileC)
Note: default link buttons are also required. For more details, see Creating the link buttons. - 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:
IF TABLE_RADFileD..Count = 0 THEN
Error("RADFileD must be typed")
RETURN
END
ScreenToFile()
IF RADFileB..NewRecord = True THEN
HAdd(RADFileB)
ELSE
HModify(RADFileB)
END
FOR EACH ROW OF TABLE_RADFileD
TABLE_RADFileD.COL_RADFileBIDRel = RADFileB.RADFileBID
TableSave(TABLE_RADFileD)
END
MyWindow..ReturnedValue = True
- 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 RADFileB..NewRecord THEN
SWITCH Dialog("A record is currently created.")
CASE 1:
ExecuteProcess(BTN_Validate, trtClick)
CASE 2
CASE 3: RETURN
END
END
- Initialization code of the window:
FileToScreen()
HFilter(RADFileD, RADFileBRelID, RADFileB.RADFileBID)
MyWindow..ReturnedValue = False
- Window closing code. This code is used to disable the filter:
HDeactivateFilter(RADFileD)
Esta página también está disponible para…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|