|
|
|
|
|
- Overview
- Principle
- Reminder
- Implementation
The RepeatString Looper control: Customized synchronization
How to manage the synchronization between: - the page displayed in the browser. This page contains a RepeatString Looper control displaying records from an HFSQL data file.
- the corresponding page context found on the server.
Via a custom management of the synchronization, when an action is performed on a row in the page (click performed on a link to order a product for instance), the information stored on the server is updated according to the identifier found in the current row on the browser. The custom synchronization method for RepeatString Page controls relies on information hidden in the page: the identifier of the selected repeat. The synchronization consists in sending to the server the identifier of the current row on the browser. Reminder The synchronization code is triggered when the following conditions are fulfilled: - the page displayed in the browser no longer corresponds to the page context on the server.
- the Web user runs a server code (by clicking a link, a button, an image, a menu option, ...). The option "Call page synchronization process if the user pressed the Back button" has not been unchecked in the "Advanced" tab of the control description running the server code.
To customize synchronization management for Looper control RepeatString files: - Check whether the mechanism for synchronization management is enabled.
- at the page level ("Using the browser's "Back" button" corresponding to "Allowed (runs the synchronization code)" in the "UI" tab of the page description).
- at each button to manage the looper or perform an action on the selected record in the looper ("Call page synchronization process if the user pressed the Back button" unchecked in the "Advanced" tab of the control description).
- Create an invisible control in the Looper control.
- Define an attribute on the value of this invisible control (named "UNIKID" for example) in the description of the Looper control. This control must contain the identifier of the current row. The initialization of this control must be performed in the click code of the link or button found in the Looper control.
- Customize the synchronization code of the current page. This synchronization code must:
- read the value of the hidden control for the current row.
- re-read the record corresponding to the identifier stored in the hidden control.
- perform the necessary processes according to the application.
An example of synchronization code can be: Str is string
Key is string
Str = "_" + PageParameter(Looper1) + "_" + UNIKID
Key = PageParameter(Str)
HReadSeek(PRODUCT, PRUNIKKEY, Key)
IF HFound() THEN
...
ChangeAction(caContinue)
ELSE
ChangeAction(caError)
END
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|