|
|
|
|
|
- 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
Creating the Relation pages of a WEBDEV RAD pattern
The steps for creating a 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. 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: - 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.
- 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. - Save the page.
- 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: - 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.
- 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.
- In the "Content" tab of the supercontrol description window, specify:
- the data file browsed: RADFichierB.
- the item browsed: RADFileBID.
- 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: - Create a Table control on the page: under the "Creación" pane, in the "Datos" group, pull down "Tabla" and select "Table".
- 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.
- 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: - 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.
- 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:
HReset(RADFileD)
RADFileD.IDLinkedRADFileB = RADFileB.RADFileBID
HAdd(RADFileD)
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)").
- 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 YesNo("Do you want to delete the record?") THEN
TableDelete(TABLE_RADFileD)
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)"). - Case of return button ("Back" button for example).
IF PreviousPage() = "" THEN
PageDisplay(PreviousPage())
ELSE
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. - Enter the declaration code of the global variables of the page. Example:
FileToPage()
HFilter(RADFileD,RADFileBIDRel,RADFileB.RADFileBID)
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.
- Enter the closing code of the page. This code is used to disable the filter:
HDeactivateFilter(RADFileD)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|