Tuto WEBDEV 25
Part 4: Internet site with data 149 ▶ Like the page used to list new products, this page must be generated in AWP mode: 1. Display the description window of the page (select "Description" from the popup menu). 2. In the "Type of page" area, select the "AWP" mode. 3. Validate. 4. Save the modifications ( or Ctrl + S). What should this page do? This page is intended to display the characteristics of the product currently selected in the Looper control. In our case, this page will be used to display the content of different items found in the "Product" data file. First of all, we are going to indicate to the page the product that will be displayed. To do so, all we have to do is declare a parameter in the page. This parameter will be passed on the URL. ▶ To declare a parameter in the page: 1. Press F2. The code editor displays the different page events. 2. Write the following code in the "Global declarations" event: PROCEDURE MyPage(gnProductID is 8-byte int) 3. Let’s take a look at this WLanguage code: • The PROCEDURE keyword in the "Global declarations" event is used to associate a procedure to the opening of the page. • The procedure is named "MyPage". At run time, this keyword will be automatically replaced by the name of current page. • The procedure expects the gnProductID variable (that is an 8-byte integer) in parameter. This variable corresponds to the product identifier that will be displayed in the page. The type of this variable is identical to the type of corresponding ProductID item described in the Product data file. This parameter contains the value that will be found in the URL. 4. Close the code editor. We are now going to create the different page controls.
Made with FlippingBook
RkJQdWJsaXNoZXIy NDQ0OA==