In this lesson we will demonstrate how to use predefined Web Controls in a Windows applications, using FlexTron. We will focus on the WebCombo control. In the Getting to know the Web Controls playlist on the DataFlex Learning Center there’s a lesson available on how to use this web control. In this current lesson we will integrate the same control, but then in a Windows application using FlexTron.
The WebCombo is used to display a dropdown combo list. A combo control appears in two parts: the top part that displays the current value (e.g., the selected item) the second part is a list of items that can be selected by the user. Using FlexTron it is easy to integrate the control in your Windows application. It offers you to make use of modern technologies and the modern styling that is used in Web Applications.
A combo is ideal for data entry that requires the use to select from a pre-defined set of valid values. E.g., a view asking for the ‘state’ field of an address. And since we will be using it in FlexTron we are able to manipulate Windows controls with our web controls and vice versa.
You can use the WebCombo with or without data binding. When used with a data binding the combo provides automatic support to display and modify data from database column. Validation rules from the data dictionary are used to build the combo list. When used without a data binding you will use the class interface to populate the combo list. You do that by implementing the OnFill event to populate the combo list. For each item you wish to add the combo list you send AddComboItem with the value of the item and the description of the item a parameter to the procedure.
If you want to support the ability to select a null value from the combo list. You can set pbAddEmptyItem to True. You can also set psEmptyItemDescription to have a value to show that this is either an empty item or a placeholder on what the users must select.
To handle specific actions based on when the user changes the value of the combo list. You would require setting pbServerOnChange to True and implement the OnChange event where you can call functions that are required when the user changes the value of the combo list.
All right now you know more about the WebCombo, I will show a demo on how to easily implement it using FlexTron in windows application and how it looks.
DEMONSTRATION
This demonstrates how you can easily use web controls in your Windows application using FlexTron!