Tuto WINDEV Mobile 25

Part 5: Android and iOS: Developing an application 113 2. Enter the following WLanguage code in the event "End of initialization of WIN_Product_form": FileToScreen() FileToScreen is used to display in the controls the data found in the data file, for the current record. In our case, the current record will be the record selected in the Looper control of "WIN_ List_of_products". This Looper control is linked to the Product data file. 3. Close the code window. 4. Save the window. Displaying the form from the list of products Let’s now see how to display the form of selected product in the list of products. ▶ Perform the following operations: 1. Position on the "List of products" window: click the "WIN_List_of_products" button in the open documents bar: 2. Select the Looper control. Caution: make sure you select the Looper control and not one of its controls. 3. Display the popup menu of Looper control (right click) and select "Code". 4.  In the code window that appears, write the following WLanguage code in the event "Selecting a row of...": OpenMobileWindow(WIN_Product_form) Remark The assisted code input is going to help you: as soon as you type the opening bracket "(", a drop-down list proposes the name of all existing windows found in the project. All you have to do is select the window with the keyboard or with the mouse. If the window name is not displayed in the list, it means that this window was not saved beforehand. 5. Save the modifications by clicking among the quick access buttons. 6. Close the code window (click X at the top right corner of code editor). ▶ Run the test of "WIN_List_of_products" window again in the simulator ( among the quick access buttons). • In the list of products, click one of the products with the mouse. • The detailed product window is displayed. ▶ Close the simulator.

RkJQdWJsaXNoZXIy NDQ0OA==