|
|
|
|
|
- Default events
- Optional events
- Optional events for managing the off-line mode
- Optional event to manage the navigation history
Events associated with pages
Several optional events can be added. To add an optional event: - Select the desired control.
- Display the code window of this control (F2 key).
- Click the link "Add other events to xxx" at the bottom of the window code, after the last event.
- All the optional events available for the control are displayed.
- Check the optional event to add and validate.
Note: Several optional events can be selected. - The selected optional event is automatically added to the events managed by the control.
To disable an optional event, simply perform the same operations to display the list of optional events. Then simply uncheck the optional events to delete. Note: If the deactivated code contains WLanguage code, this code is automatically deleted.. You can manage, for example: - left mouse button down, up, double click,
- right button down, up, with double click, ...
Optional events for managing the off-line mode Several optional events can be used to optimize the management of offline sites: | | Event | Runtime condition |
---|
Switch to off-line mode (Browser code) | Executed when switching to off-line mode. | Switch to on-line mode (Browser code) | Executed when switching to on-line mode. | Whenever the status of the HTML cache changes (Browser code) | This event is used to check what happens when the page is loaded. This event is called whenever the cache is checked. The following command line is used to retrieve the actions performed by the browser:Trace(JSInfoEvent("type"))
You have the ability to find out: - whether the browser is currently updating the cache,
- whether an error occurs
- whether the update of the cache is completed
- whether no update must be performed, ....
|
Optional event to manage the navigation history To optimize management of the previous/next buttons, a specific optional event is available: "Move in navigation history (onpopstate)".. If the Web user goes back to an entry in the history, the stored data will be transmitted to the "Move in the navigation history" event (optional page event). This event must process the data in order to restore the page status. This process must be associated with a procedure that expects the transmitted data as parameter: // Evénement "Déplacement dans l'historique de navigation (onpopstate)" PROCEDURE <NomProcédure>(<Données>) Example: This example adds the page into the history and stores the insertion time. Going back to the previous history page displays the time. x is Variant
x.Heure = TimeSys()
BrowserHistoryAdd(x, MyPage.Titre, "#avant")
x.Heure = TimeSys()
BrowserHistoryAdd(x, MyPage.Titre, "#apres")
PROCEDURE TraitementHistorique(stEtat)
Info(stEtat.Heure)
Note: Depending on the browser, the "Move to browsing history (onpopstate)" event is also executed when the page is loaded, and when the page is returned to its initial display.. In this case, the <Data> parameter transmitted to the event corresponds to Null.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|