DBComboBox with key and value for each Item

I have a component suggestion.

A DBComboBox with key and value for each Item.

Example: I have a list with:
Male = M
Female = F

In the DBComboBox it shows the Male or Female text and when writing to the database it writes M or F

Is TWebDBLookupComboBox not what you need?

But the Male and Female information does not come from the database, it is an enumerator, in the database it only records M or F, in the TWebDBLookupComboBox I will have to connect it to a ListSource.

Maybe I'm doing it wrong.

Please, do you have an example of how the TWebDBLookupComboBox and HTML configuration would look like?

I'm using Bootstrap.

It was not clear you could not use a ListSource.
If there is no listsource, we'll make an adaption of TWebDBComboBox in the next update where you can use something like:

  webcombobox1.Items.AddPair('M','Male');
  webcombobox1.Items.AddPair('F','Female');

and this will show Male/Female in the dropdown but persist as M or F in the DB.

1 Like