- Which page should be displayed?
- Where should the page be displayed?
- Choosing a target
- Current browser (_top)
- Current frame (_self)
- Parent frame (_parent)
- New browser (_blank)
24. Displaying and sequencing pages
In most cases, a site includes a set of pages. These pages are linked together via buttons (or links). A click performed on a button is used to display a new page.
Two questions must be asked before a new page is displayed:
- which page should be displayed?
- where should the page be displayed (new browser, frame, etc.)?
Which page should be displayed?
The page to display can be defined:
Selecting the page to display in the page editor (most common method)
- in the page editor (no programming is required).
- in the code editor, in a process of the button (or link or clickable image, etc.).
Selecting the page to display by programming
|To define the page to display:|
- Open the control description window (right click, "Description").
- In the type of action, select "Display a page of the site".
- Select the page to display.
The page to display must be selected by programming when:
- several pages can be displayed (an error page if the password is not entered or the next site page for example).
- 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, etc.
The target can be defined:
- in the page editor: no programming is required.
- in the code editor, in a process 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 selected by programming. For example, if the user does not enter their password, an error page will appear in a new browser; otherwise, the next page will appear in the current browser.
is used to change the target of an action by programming. This function must be used in browser code.
When choosing the target for a Button control, Link control, Clickable Image control, or a menu option, ... you can select:
- a preset target: four preset targets are proposed:
- Current browser (_top),
- Current frame (_self),
- Parent frame (_parent),
- New browser (_blank). In this case, the new browser can correspond to a new tab or a new browser with specific characteristics (menu bar, message bar, etc.)..
- a frame in the current frameset.
Remark: in the diagrams below, the grayed area represents the area where the page is displayed when the Button control is clicked on.