- 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: To build a RAD pattern used to create a full project, the following files are required:
- 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 supplied with WEBDEV 25.
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 browsing table, 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 among the quick access buttons.
- The element creation window appears: click "Page" then "Page".
- The page creation wizard starts.
- 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, ...).
Remark: If you want to indicate the name of the current file to the user, use the name of the file (RADFileA for example) in a caption. The RADFileX term will be automatically replaced by the caption of the file described in the analysis.
- Save the page.
- Create a Table control in the page: on the "Creation" pane, in the "Data" group, expand "Table" and select "Table".
- In the table creation wizard, specify the following characteristics:
- Select "Display the data from a file or from a query".
- 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:
// Create a new record
// Open the form of RADFileA in creation mode
- 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:
// Is a row selected?
IF TableSelect(TABLE_RADFileA) = -1 THEN RETURN
// Open the form of RADFileA in modification mode
- 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 the deletion is confirmed, delete the table row and
// the corresponding record from the FileA file
IF YesNo("Do you want to delete the record?") THEN
// Delete the record from the table
// Position on the current record
Error("An error occurred during the deletion.", HErrorInfo())
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).
// Are we coming from a page?
IF PreviousPage() = "" THEN
// Yes, display this page
// No, go back to the home page
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. See Menu page for more details.
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:
// Create a unique file name
sFile is string = fDataDir() + "\" + DateSys() + TimeSys() + ".pdf"
// Print the report in a PDF file
// Generate the report
// Display the report in PDF format
// Delete the file
CAUTION: There is no need to customize the reports found in your project of the 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.