|
|
|
|
|
- The steps for creating a RAD pattern
- Which pages must be created?
- The files to create
- Standard to follow
- The Table pages
- Creating a Table page
- Case of print buttons
Creating the Table pages of the 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 2025. These rules are recommendations. You can implement and use your own standard. A Table page contains 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: New, Modify, Delete, Back and Print if necessary.
Example: Table page on the RADFileA file of the Simple Template pattern: Creating a Table page To create a Table 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". You can select the template used in your pattern.
- In the description window, enter the name of the page. This name must necessarily contain the name of the file displayed in the table (some examples: PAGE_Table_RADFileA, PAGE_Tab_RADFileA, ...).
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.
- Create a Table control on the page: under the "Creation" pane, in the "Data" group, pull down "Table and List Box" 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 (RADFileA for example).
- Keep the proposed item as well as the search item.
- Validate the name of the table.
- Position the Table control in the page and define its size. The column corresponding to the identifier can be invisible if necessary.
- Create and position the different buttons your page (validation, modification, deletion, print, back, ...). These buttons can have any name.
- Case of addition button (New button for example).
This button can be used to enter a new record in a form page for instance. The code of the New button can be:
HReset(RADFileA)
PageDisplay(PAGE_Form_RADFileA)
- Case of modification button (Modify button for example).
This button can be used to modify a new record in a form page for example. The code of the Modify button can be:
IF TableSelect(TABLE_RADFileA) = -1 THEN RETURN
PageDisplay(PAGE_Form_RADFileA)
- 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 the Delete button can be (for the table on RADFileA):
IF YesNo("Do you want to delete the record?") THEN
TableDelete(TABLE_RADFileA)
TableDisplay(TABLE_RADFileA, 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 correspond to the home page of the site and it can contain the main menu of the site. For more details, see Menu page.
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:
sFile is string = fDataDir() + "\" + DateSys() + TimeSys() + ".pdf"
iDestination(iPDF, sFile)
iPrintReport(RPT_List_RADFileA)
FileDisplay(sFile, "application/pdf")
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|