- Overview
- Default synchronization
- Overview
- Implementation
- Remarks
- Synchronization through programming
- Remarks
Managing the synchronization
Overview The synchronization mechanism is triggered only if the option "Use the mechanism for synchronizing pages" is selected for the page. If a desynchronization occurs, a warning message informs the user that the requested action has not been performed. The page corresponding to the context found on the server is redisplayed. The site can continue to operate. Implementation To implement the management of synchronization in a page: - On the "UI" tab of the page description ("Description" in the popup menu), in "Using the browser "Back" button", select "Allowed (runs the synchronization code)".
- Validate. This page will be automatically included in the browser page history: to go back to this page, click the browser "Back" button.
To implement the management of synchronization in all project pages: - Open the project description: on the "Project" tab, in the "Project" group, click "Description". In the "Advanced" tab, in "Default option for the browser "Back" button", select "Allowed (runs the synchronization code)".
- Validate. The project pages will be automatically included in the browser page history: to go back to these pages, click the browser "Back" button.
Remarks - This management mode requires no specific WLanguage code.
- The synchronization mechanism can be disabled for the page controls that do not require a synchronization ("Close" button for example): simply uncheck "Call the page synchronization process if the user pressed the browser Back button" in the "Advanced" tab of the control description.
- The warning message can be customized (see the synchronization through programming).
Synchronization through programming To manage the synchronization through programming: - On the "UI" tab of the page description ("Description" in the popup menu), in "Using the browser "Back" button", select "Allowed (runs the synchronization code)".
- Configure (if necessary) the page controls for which the synchronization must not be managed.
For each control that triggers an action on the server, you can specify whether the page synchronization must be managed (default option) or ignored during this action. To ignore the synchronization management, simply uncheck "Call the page synchronization process if the user pressed the browser Back button" in the "Advanced" tab of the control description. - Enter the code required to set a custom synchronization in the page synchronization code. Use ChangeAction in the page synchronization code. This function is used to define the action that will be performed if the page is desynchronized.
Remarks - ChangeAction is initialized with "No action" if a WLanguage function used to display or redisplay a page is called in the synchronization code of the page.
- To customize the desynchronization message, specify the following in the page synchronization code:
- the custom message
- the redisplay of the current page on the server (with PageRefresh for example).
- To perform a synchronization from the information on the user's computer, it is recommended to:
- use a hidden control containing the identifier of displayed and selected record,
- in the synchronization code, find the current record on the browser. This search is performed from the identifier found in the hidden control.
- refresh the page.
|
|
|
|