Article Details
Id:11878
Product:finPOWER Connect
Type:NEW
Version:2.01.00
Opened:15/05/2014
Closed:16/05/2014
Released:27/06/2014
Job: J013271

Page Sets; DBComboBox; Data binding enhanced

Binding data to a DBComboBox on a Page Set has been enhanced in the following ways:

  • A new 'DataView' source type can be specified.
    • This just indicates to the User Interface that the Page Set Script will handle the data binding (you could use 'None' to indicate this but 'DataView' is more intuitive.
  • A new RefreshDataView method is available from the Page Set Script for DBComboBox type Page Objects.
  • The RefreshStandardRange method of the DBComboBox allowed a 'fieldList' to be specified however, this was not previously implemented. Now, specifying a comma-separated list of field allows you to refine what is displayed in the dropdown grid.

The following code sample shows a few ways of binding a DataView to a DBComboBox.

Dim dv As DataView

' Bind to an Information List using special list functionality
If finBL.ResolveListAsDataView("LIST.BankShortNames", dv) Then
  cboComboBox1.RefreshDataView(dv, "Value", "ValueAlt")
End If

' Bind to an Information List using method on finInformationListRO object
' NOTE: This method allows us to control the column names, i.e., change then from Value and ValueAlt
If finBL.InformationLists("BankShortNames").GetDataView(dv, "Bank", "Description", False) Then
  cboComboBox1.RefreshDataView(dv, "Bank", "Description")
End If

' Bind to a list of Promotions for an Account Type (could also use the GetAvailablePromotionsDataView method)
If finBL.AccountTypes("VL").Promotions.GetDataView(dv, "") Then
  cboComboBox1.RefreshDataView(dv, "PromotionId", "Description", "PromotionId,Description,IsAvailable")
End If

' Bind to a Standard Range but override the columns to display
' NOTE: The column names match the properties on the business layer, e.g., finScriptRO properties
cboComboBox1.RefreshStandardRange(isefinStandardRange.Scripts, "", "", False, "ScriptId,Description,ScriptTypeText")