|
|
|
|
|
- Default events
- Optional events
- Optional events for managing the off-line mode
- Optional event to manage the navigation history
Events associated with pages
Related Examples:
|
Complete examples (WEBDEV): WW_Forum_PHP
[ + ] This example proposes the main features of a user forum (creation of forums, topics and messages, moderator, search, etc.) Some of the features used by WW_FORUM_PHP: - Rich control - AJAX -...
|
|
Complete examples (WEBDEV): WW_Blogs_php
[ + ] This example is a PHP site created with WEBDEV for managing blogs. A blog is a log or a diary on an Internet site. It can be consulted by everyone and everyone can write his own comments. The author of the blog writes messages whenever he wants to. You have the ability to format the text, to include images, notes, and so on. Furthermore, each blog can be exported in RSS.
|
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.
Remark: You can select several optional events. - 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. Remark: If the disabled 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 A specific optional event is available to optimize the management of Back/Next buttons: "Move into the 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: // Event "Move in the navigation history (onpopstate)" PROCEDURE <ProcedureName>(<Data>) 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.Time = TimeSys() BrowserHistoryAdd(x, MyPage.Title, "#before") Â x.Time = TimeSys() BrowserHistoryAdd(x, MyPage.Title, "#after")
// Event "Move in the navigation history (onpopstate)" PROCÉDURE ProcessHistory(stStatus) Info(stStatus.Time)
Remark: Depending on the browser, the event "Move in the navigation history (onpopstate)" is also run when loading the page and when going back to the initial page display. In this case, the <Data> parameter transmitted to the event corresponds to Null.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|