Unexpected behaviour with TWebDBLookupCombobox

I have two TWebDBLookupComboxes on a form, each with its own TWebDataSource which are connected to the same TXDataWebDataSet.

When one combo box is changed, the other one changes it display value (not the underlying value) And vice versa. If I change the first one to say item 1, the second one will change, but not to item1.

It looks like when the other combobox changes, it changes its display value to the the original value that was saved in the record.

This used to work. The crazy thing is that the client has been using it fine, when I was using the same DataSource for both of them. Now, even after using different datasources, they appear to be linked. Also, the generated html has no selected attribute on any option. Is this normal?

Is this a known bug? Or is my understanding is shot?

  object edtRole1: TWebDBLookupComboBox [39]
    Left = 74
    Top = 305
    Width = 73
    Height = 21
    ElementID = 'form.edtRole1'
    HeightPercent = 100.000000000000000000
    WidthPercent = 100.000000000000000000
    DataField = 'Role1'
    DataSource = src_
    KeyField = 'Ref'
    ListField = 'Name'
    ListSource = src_Roles1_
  end

  object edtRole2: TWebDBLookupComboBox [42]
    Left = 221
    Top = 305
    Width = 68
    Height = 21
    ElementID = 'form.edtRole2'
    HeightPercent = 100.000000000000000000
    WidthPercent = 100.000000000000000000
    DataField = 'Role2'
    DataSource = src_
    KeyField = 'Ref'
    ListField = 'Name'
    ListSource = src_Roles2_
  end

    object xds_Role1: TLargeintField
      DisplayLabel = 'Role 1'
      FieldName = 'Role1'
      Required = True
    end
    object xds_Role2: TLargeintField
      DisplayLabel = 'Role 2'
      FieldName = 'Role2'
    end

  object src_Roles1_: TWebDataSource
    AutoEdit = False
    DataSet = Aux.xdsStaff_Roles
    Left = 176
    Top = 64
  end
  object src_Roles2_: TWebDataSource
    AutoEdit = False
    DataSet = Aux.xdsStaff_Roles
    Left = 224
    Top = 64
  end



There is yet another quirk.

The only way to preset the value or to read its value is to use ItemIndex.

But the lookuptable is of the form

'X' -> Please Ask Client'
'Y' -> 'Required'
'N' -> 'Not Required'

And I want to use X, Y or N, which is the whole point of using the lookupcombobox. This is what is stored in the table.

To be honest, I cant recall if VCL is the same, if it is, I would have fixed it in Delphi 1 with descendant classes. I have had to write an extensive helper class for TMS Webcore.

Did you compare with the demo Demo\Basics\DBLookupCombo ?

There is the value and the display value. When you set in the dataset the field to the desired value, the TWebDBLookupComboBox should display the expected DisplayValue.