|
|
|
|
|
- Overview
- There are two methods to configure the browser "Back" button
- Example of desynchronization
Configuring the browser "Back" button
The "Back" button allows users to see the history of pages they previously visited. In a WEBDEV site in Session mode, each HTML page displayed on the browser is associated with a page context present on the server. Every action performed in the browser must be synchronized with the corresponding page session on the server. However, the browser "Back" button is used to perform an action on the browser only: the page displayed in the browser and its context on the server can be desynchronized if the browser "Back" button is used. Special case: Single Page App type sites: A Single Page App corresponds to a single page! So the Back button defaults to the page displayed before the application was launched! To manage the "Back" button correctly in this case, see Single Page App. There are two methods to configure the browser "Back" button To avoid out-of-sync problems between the pages displayed in the browser and the corresponding sessions on the server, WEBDEV offers two methods for configuring the "Back" button: - Solution 1: Prevent return to this page from the browser's "Back" button.
If the "Back" button is used to go the previous page, this action will have no effect. For more details, see Preventing the use of the "Back" button. - Solution 2 Synchronization management (default solution)
For each action performed in the browser, the synchronization between the HTML page and its session is automatically checked. There are two methods to manage synchronization:- default synchronization (default mode used when creating a new page).
- manage synchronization programmatically.
For more details, see Managing synchronization. Example of desynchronization Let's see an example of a site: - A page contains a Table control linked to an "ITEM" data file and a "Next" link.
- The ITEM data file contains a single item, each record includes a letter of the alphabet.
- The page displays 6 rows of the Table control and the "Next" link displays the next 6 rows.
When the page is opened, the Table control displays the first 6 records in the data file (from 'A' to 'F'). The user performs the following series of actions: - Click on the "Next" link
Result The server positions itself on the next 6 ITEM records and returns their contents to the browser. The browser displays the next page of the Table control with the 6 new contents ('G' to 'L'). - Click on the "Back" button
Result: the browser displays the page preceding the first action. The Table control shows letters 'A' to 'F'. The server didn't receive any update request from the browser, so the position is still set on records 'G' to 'L' on the server side. - Click on the "Next" link
Result The server positions itself on the next 6 ITEM records (from 'M' to 'R'). The browser synchronizes with the server and displays the same elements: the Web user has the feeling that some information is not displayed.
This can have undesired effects when modifying a record in a data file (e.g., the user sees a record but actually modifies another). Reminder every action on the browser must result in an action on the server: the server then sends a response to the browser. However, the "Back" button is only taken into account on the browser side, which means that the server cannot send a response.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|