Tuto WINDEV Mobile 25

154 Part 5: Android and iOS: Developing an application ▶ The setting of "Pull to refresh" has added: • the refresh bar that will be displayed to the user during the operation. • the "Refreshing by pull/release" event among the Looper control events. This event is automatically called during the refresh gesture. We are now going modify the WLanguage code of this event in order to manage how the control is refreshed. ▶ To modify the WLanguage code of the event "Refreshing by pull/release": 1. Select the Looper control and display the associated event (press F2 for example). 2.  In the code editor, type the following WLanguage code in the event "Refreshing by pull/ release": LooperDisplay(LOOP_QRY_Products,taReExecuteQuery) 3. As already seen for the search management, LooperDisplay is used to redisplay the Looper control. The taReExecuteQuery constant is used to re-run the base query of Looper control and therefore to take into account the new records entered in the database. 4. Save the modifications by clicking among the quick access buttons. 5. Close the code window (click X at the top right corner of code editor). ▶ Test the window that was just created in the simulator ( among the quick access buttons). 1. Click the top of looper with the mouse and move the mouse to the bottom. 2. Release the mouse. The looper is updated. 3. Close the simulator. This example allows you to understand the implementation of "Pull to refresh" feature. This feature can be used for example in the same application in HFSQL Client/Server where other users would update or add products. These modifications could be displayed by the "Pull to refresh" feature.

RkJQdWJsaXNoZXIy NDQ0OA==