DBDropDown in TMS webCore

How do I create a lookup combobox which is not linked to a field in a table?
The TWebDBLookupCombobox is disabled when I do not fill in the fields DataField and DataSource. But I want to put a combobox on the form where I can choose what to filter on, so I only need the keyfield corresponding to the value field.

Do you use the latest version v2.9.6.0 of TMS WEB Core?
Using the ListSource / ListField should be sufficient in that case.

I now use 2.9.5.1 (just downloaded from your site).
What I see happening:

  • when I do not bind the values for DataSource and DataField I cannot drop down the list and select an item. I know the list is filled, since when I set the ItemIndex run-time to a value, the correct item is selected/displayed.
  • When I bind the properties DataSource and DataField, the drop-down neatly appears.
    So, whats happening?

Sorry, I confused with TWebDBEditDropDownTableControl where we did an improvement to ensure the control is enabled also when no DataSource is assigned. This improvement was added in v2.9.5.0
We've now revisited the TWebDBLookupComboBox as well and did the same improvement. This will be included in the next release.

I have put a TWebDBLookupComboBox on my Form and did not assign anything to the Datasource property. Although the values are now visible, when I select an Item in the list a crash occurs in

TDBLookupComboBox.Change in the line

if DataSource.AutoEdit or (DataSource.DataSet.State in [dsEdit, dsInsert]) then

Am I doing something wrong? I am using 2.9.8.0.

Best,
Peter

Change in WEBLib.DBCtrls.pas in the “Core Source” subfolder the line

if DataSource.AutoEdit or (DataSource.DataSet.State in [dsEdit, dsInsert]) then

to

if Assigned(DataSource) and (DataSource.AutoEdit or (DataSource.DataSet.State in [dsEdit, dsInsert])) then

I will do. But it is a bug in Webcore, isn’t it? So I presume it will be fixed in the next release?

Thanks again.

Yes, it will be applied in the next update.