Tuto WEBDEV 25

Part 5: Let’s continue the development 189 ▶ The new option "All orders" means that the query parameter "ParamStatus" will be ignored. To ignore a query parameter, simply assign the NULL value to this parameter. We will manage this case for ParamStatus. 1. Select the Table control in the editor and display its events (press F2 or select "Code" from the control popup menu). 2.  In the "Initializing" event of the Table control, replace the line: MySource.ParamStatus = RADIO_Status by: SWITCH RADIO_Status // All orders CASE 1 MySource.ParamStatus = Null OTHER CASE MySource.ParamStatus = RADIO_Status-1 END In this code, if the RADIO_Status control corresponds to 1 (case of "All orders" option), the parameter of associated query has "NULL" for value. Otherwise, the parameter has for value the number of the selected option minus 1 (that corresponds to the option that was just added). 3. Close the code editor. ▶ Let’s run the test of our page. 1. Save the page by clicking among the quick access buttons. 2. Click among the quick access buttons. 3.  Type the name "ADDAMS" and select "All orders". 4. Click "FIND": all orders placed by the customer named ADDAMS are listed, regardless of their status. 5. Close the browser.

RkJQdWJsaXNoZXIy NDQ0OA==