Tuto WINDEV Mobile 25
Part 5: Android and iOS: Developing an application 117 • Write the following WLanguage code in the event "Selecting the menu": ScreenToFile() HSave(Product) Close() Let’s take a look at these lines of code: • ScreenToFile is used to initialize the items with the values of linked controls, for the current record. • HSave is used to update the file data for the current record. 7. Save the modifications by clicking among the quick access buttons. 8. Close the code window (click X at the top right corner of code editor). ▶ When closing the product form, the content of the product list found in the "WIN_List_of_ products" window must be refreshed to take into account the modifications performed in the form. To do so, use the event "Closing a child window" of "WIN_List_of_products". 1. Click the "WIN_List_of_products" button in the open documents bar: 2. Right-click the window background and select "Code" from the popup menu. The following WLanguage code is automatically displayed in the event "Closing a child window": LooperDisplay(LOOP_Product, taCurrentSelection) Let’s take a look at this WLanguage code: • The event "Closing a child window" is run whenever a child window of the current window is closed. In our case, it is run when the "WIN_Product_form" window is closed. • LooperDisplay is used to update the data found in the Looper control of "WIN_List_of_ products" window. The taCurrentSelection constant is used to update data from the selection bar. This WLanguage code was automatically generated when the wizard created the window. 3. Close the code window (click X at the top right corner of code editor). ▶ Run the test of "WIN_List_of_products" window in the simulator ( among the quick access buttons). • In the list of products, click one of the products with the mouse: for example, the "Polo Hibiscus Blue" product. • The detailed window of product is displayed. Modify the product name and type "Polo Hibiscus Light blue" and click the "OK" button. • When going back to the list of products, you will notice that the name of this article was updated. ▶ Close the simulator. The WINDEV Mobile editor is displayed.
Made with FlippingBook
RkJQdWJsaXNoZXIy NDQ0OA==