Tuto WEBDEV 25
124 Part 3: Intranet site with data 3. Then, click inside the Looper control (bottom right, for example) to create the Link control. 4. Change the Link control caption (press Space to edit the caption): the new caption is "Modify". ▶ The "Modify" Link control must open "PAGE_Product_form". We are going to open this page by programming. 1. Select the "Modify" Link control and display the associated WLanguage events (F2). 2. In the code window that appears, write the following code in the "Click (server)" event: PageDisplay(PAGE_Product_form,ATT_ProductID[LOOP_Product]) 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 pages found in the project. All you have to do is select the page with the keyboard or with the mouse. If the name of requested page is not found in the list, it means that this one was not saved beforehand. 3. Let’s take a look at this WLanguage code: • PageDisplay is used to open the "PAGE_Product_form" page. • The opened page expects in parameter the identifier of product to display. This identifier corresponds to the identifier of the product selected in the Looper control. To get the identifier, you must specify the attribute that contains the identifier (ATT_ProductID) for the current row. The brackets are used to specify the row and LOOP_Product is used to get the current row in the Looper control. Remark By default, ATT_ProductID returns the attribute value for the row that was clicked. The code can be written as follows: PageDisplay(PAGE_Product_form,ATT_ProductID)
Made with FlippingBook
RkJQdWJsaXNoZXIy NDQ0OA==