|
|
|
|
|
- Which page to display?
- Where should the page be displayed?
- Choosing a target
- Current browser (_top)
- Current frame (_self)
- Parent frame (_parent)
- New browser (_blank)
24. Displaying and linking pages
In most cases, a site includes a set of pages. These pages are linked together via buttons (or links). Clicking a button displays a new page. Two points must be considered before displaying a page: - which page to display?
- where should the page be displayed (new browser, frame, etc.)?
The page to display can be defined: - in the page editor (no programming required).
- in the code editor, in an event of the Button control (or Link or Image (with clickable areas), etc.).
Selecting the page to display in the page editor (most common method) | | To define the page to display:- Open the control description window (right click, "Description").
- In the type of action, select "Display a site page".
- Select the page to display.
| | Selecting the page to display programmaticallyThe page must be selected programmatically when: - several pages can be displayed (e.g., an error page if the password is not entered or the next page of the site).
- a specific action must be performed on the server (calculation, read a record, etc.).
Where should the page be displayed? A page is displayed in a specific target: current page, new browser tab, etc. The target can be defined: - in the page editor (no programming required).
- in the code editor, in an event of the Button (or Link) control.
Several WLanguage functions allow you to open a new page (or frameset). The main functions are: Selecting the target in the page editor (most common method) | | In a Button control, to define the target of the page to display:- Open the description of the Button or Link control (right click, "Description").
- In the list of targets, select a preset target or a frame (in the case of a frameset).
| |
Selecting the target in the code editor When the target depends on a choice made by the user, this target must be defined programmatically. For example, if the user does not enter their password, an error page will appear in a new browser tab; otherwise, the next page will appear in the current browser. ChangeTarget is used to change the target of an action programmatically. This function must be used in browser code. When choosing the target for a Button, Link, Image control (with clickable areas), menu option, etc., you can select: - a preset target. Four preset targets are available:
- Current browser (_top)
- Current frame (_self)
- Parent frame (_parent)
- New browser (_blank). In this case, the new browser can be a new browser tab or a new browser with specific characteristics (menu bar, status bar, etc.).
- a frame in the current frameset.
Note: In the images below, grayed-out areas represent the areas in which the page is displayed when the Button control is clicked.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|