Tuto WINDEV Mobile 25

150 Part 5: Android and iOS: Developing an application 12. Validate the wizard. The window is automatically created, displayed in the editor and saved. ▶ We are now going to modify the "WIN_List_of_products_Advanced" window in order to display the Product form that was created in a previous lesson. 1. Right-click the Looper control and select "Code". Caution : make sure you select the Looper control and not one of the controls it contains. 2.  In the code editor, type the following WLanguage code in the "Initializing..." event: QRY_Products.ParamName = Null 3.  This code line is used to initialize the value of parameter found in the "QRY_Products" query used by the Looper control. By default, the value of this parameter is set to "Null", allowing you to ignore the parameter. Therefore, all products will be displayed in the window. 4.  In the code editor, type the following WLanguage code in the event "Selecting a row ...": HReadSeek(Product,ProductID,QRY_Products.ProductID) OpenMobileWindow(WIN_Product_form) Let’s study this code: • The Looper control is based on the QRY_Product query. When selecting the product in the Looper control, the selected record is the one found in the query. • During a click on the control row, we want to open the form window that was created beforehand. This window is based on the Product data file. • The record selected by the query must be found in the "Product" data file in order to load the buffer of the selected data in memory. The operation is performed by HReadSeek . • Then, the form window named "WIN_Product_form" is opened by OpenMobileWindow .

RkJQdWJsaXNoZXIy NDQ0OA==