To continue with this content, please log in with your Data Access ID or create a new account.
Cancel Data Access ID
You may not be authorized to see this content. Please contact Data Access Europe for more information.
Cancel Data Access Europe
You are not authorized to see this content.
Cancel Data Access Europe
Next lesson:
WebCombo using FlexTron
Cancel

Getting to know the Web Controls

Lesson 13 - WebCombo

In this lesson we’ll look at the WebCombo control in DataFlex. The WebCombo is a control that displays a combobox. You can use events after someone selects a dropdown item. Commonly used events are the “OnFill” event and the “OnChange” event. 

  • You can use the “OnFill” event to add initial values to the WebCombo. 
  • You can call the “Onchange” event can be used to trigger a specific action. For example: “Filtering a list”.

Now you know more about the WebCombo, I will show you how to implement it and how it looks.


DEMONSTRATION

  • I already created an empty WebView with a list in it for this example.
  • We are going to use a WebCombo to filter the list by a city. I have added two DDO’s. These DDO’s are created from the table “product” and its parent table “City”. These tables are related on the column “CityID”. We are going to use the City to filter the list with products.
  • Now that we have some data to work with, we will add a “WebCombo” to the view.
  • By clicking on the component and then navigating to “properties”, we can add specific events.
  • We will add the “OnFill” and the “OnChange” event.
  • The next step is to add logic to the “OnFill” and the “OnChange” event.
  • In the “OnFill” event we fill the combo items with city names and id’s. The procedure “AddComboItem” can be used to add the items.
  • We use the “OnChange” event to rebuild the constraints and load the filtered data to the list again.
  • We activate the "OnChange" event in the WebCombo and add an empty item.
  • We will use this “OnConstrain” function within the DD to add the filter itself.
  • Now compile/run and there you go. Here we have got a fully working WebCombo.