ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / Developing an application or website / Controls, windows and pages / Page / Back button
  • Overview
  • There are two methods to configure the browser "Back" button
  • Example of desynchronization
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
Overview
The "Back" button allows users to see the history of pages they previously visited.
In a WEBDEV website in Session mode, each HTML page displayed in the browser is associated with a page session on the server side. Every action performed in the browser must be synchronized with the corresponding page session on the server.
However, the "Back" button performs an action on the browser side only: the page displayed on the browser and its session on the server may therefore be desynchronized when the "Back" button is used.
For more details, see "Example of desynchronization".
Special case: Single Page App sites: A Single Page App corresponds to a single page! Therefore, the Back button returns to the page displayed when starting the application! To manage the "Back" button properly, 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 the use of the "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: Manage synchronization (default)
    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
  1. Click on the "Next" link
    Result: the server sets the position on the next 6 records of the ITEM data file 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').
  2. 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.
  3. Click on the "Next" link
    Result: the position on the server side is set on the next 6 records of the ITEM data file ('M' to 'R'). The browser is synchronized with the server and shows the same elements: to the user, some information will be missing.
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: all actions in the browser should be synchronized with the session on the server side: the server should send 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.
Minimum version required
  • Version 9
Comments
Click [Add] to post a comment

Last update: 07/03/2024

Send a report | Local help