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:
WebColumnDate
Cancel

Getting to know the Web Controls

Lesson 8 - WebColumnCombo

The WebColumnCombo is a control that displays a combobox within a WebGrid. 

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 WebColumnCombo. 
  • The “Onchange” event can be used to trigger a specific action. For example: “Saving the current record”.

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


DEMONSTRATION

  • I already created an empty WebView for this example. 
  • By navigating to the DDO explorer 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”.
  • I open the WebApp Designer.
  • Now that we have data to work with, we will add a “datagrid” and the “cWebColumnCombo” inside it.
  • By clicking on the component and then navigating to “properties”, we can add specific events. 
  • We will add the “OnFill” event and the “OnChange” event by double clicking on the name of the event.
  • We will also add the “OnNavigateForward” event to the view. This event will be used for filling the list initially.
  • The next step is to add an entry_item to the “WebColumnCombo” and add logic to the “OnFill” and the “OnChange” event.
  • In the “OnFill” event we fill the list with combo items. Initially with data form the city table. 
  • The procedure “AddComboItem” can be used to add the items.
  • In the “OnChange” event I have created a “save” procedure  for saving the city to the “products” table.
  • Be careful, enable the pbServerOnChange property, otherwise the “OnChange” event won’t be triggered.
  • I have also added the name of the product as a webcolumn, so we have got some dummy data in the table.
  • Now compile/run and there you go. Here we have a fully working WebColumnCombo.