Tuto WEBDEV 25

190 Part 5: Let’s continue the development Third parameter: Payment mode Several payment modes can be used for an order: cash, checks, ... The available payment modes are stored in the "PaymentMode" data file. We will be using a Combo Box control based on this data file to allow the user to select the requested payment mode. Remark The "Combo Box" control is used to display a list of elements and to select an element from this list. Unlike a list box, a combo box displays a single element at a time: during a click on the control, the combo box is expanded and it proposes to select another element. A single element is selected. The elements displayed in a combo box can be defined when creating the control in the editor. These elements: • are defined by programming. • come from a data file or from a query. ▶ To create a Combo Box control: 1. On the "Creation" pane, in the "Usual controls" group, click "Combo Box". 2. Click the location where the control must be created in the window (beside the radio button that was just created for example). 3.  The wizard for creating the Combo Box control starts. 4. Select "Display the data found in a file or in an existing query" and go to the next step. 5. Select the "PaymentMode" data file and go to the next step. 6.  The item that will be displayed in the Combo Box control is "Caption". Select "Caption". Go to the next step. 7. Select the search key: "Caption". Go to the next step. 8. Select the return value: "PaymentModeID". This return value is very important because it will be passed in parameter to the query. Go to the next step. 9. Keep the default options in the different wizard steps and validate the creation of Combo Box control. 10.  The Combo Box control is automatically created in the page.

RkJQdWJsaXNoZXIy NDQ0OA==