WEBDEV Concepts

Part 4: Advanced concepts 151 To enable synchronization in all the pages of the project : 1. Open the project description: on the "Project" tab, in the "Project" group, click "Description". 2.  In the "Advanced" tab, for "Default option for the browser "Back" button", check "Allowed (runs the synchronization code)". 3. 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 page synchronization process if the user has used the browser "Previous" button" in the "Advanced" tab of the control description. • The warning message can be customized (see next paragraph). 4 Synchronization through programming To set the synchronization through programming : 1. Open the page description window: on the "Page" tab, in the "Description" group, click "Description". 2.  In the "UI" tab, for "Using the browser "Back" button", select "Allowed". 3. 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. 4. 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 that allows displaying or re-displaying a page is used in the page synchronization code. • To customize the desynchronization message, specify the following in the page synchronization code: 1.  the custommessage. 2. how to re-display 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: 1. Use a hidden control containing the identifier of the displayed and selected record. 2.  In the synchronization code, find the current record on the browser. This search is performed using the identifier in the hidden control 3. Refresh the page.

RkJQdWJsaXNoZXIy NDQ0OA==