View Issue Details

IDProjectCategoryView StatusLast Update
0006361JEDI VCL00 JVCL Componentspublic2019-05-29 10:10
ReporterricoleboAssigned Toobones 
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Product Version3.47 
Target VersionFixed in VersionDaily / GIT 
Summary0006361: JvDBCombobox : Bug because search key is case insensitive
DescriptionWhen the keyList are like this : kkk;KKK,KkK ... the comboBox can't work because the indeOf to find the key is case insensitive and so the seach found always the first value of the list.

This bug can be simply fixed, just set the TSTringList.caseSensitive to true

I attach a demo to show you the bug and how to fix it.
Additional InformationThe Fix : unit JvDBCombobox.pas

//=== { TJvCustomDBComboBox } ================================================

constructor TJvCustomDBComboBox.Create(AOwner: TComponent);
begin
  inherited Create(AOwner);
  ControlStyle := ControlStyle + [csReplicatable];
  FDataLink := TFieldDataLink.Create;
  FDataLink.Control := Self;
  FDataLink.OnDataChange := DataChange;
  FDataLink.OnUpdateData := UpdateData;
  FDataLink.OnEditingChange := EditingChange;
  FPaintControl := TPaintControl.Create(Self, 'COMBOBOX');
  FBeepOnError := False;

  FListSettings := TJvDBComboBoxListSettings.Create(Self);
  FValues := TStringList.Create;
  FValues.CaseSensitive := True; // Fix
  FValues.OnChange := ValuesChanged;
  FEnableValues := True;
  Style := csDropDownList;
end;

TagsNo tags attached.

Activities

2014-11-22 00:40

 

TJvDBComboBox.zip (19,369 bytes)

mh

2019-05-20 21:40

reporter   ~0021847

Pull request created and a property for controlling the search behavior added:
https://github.com/project-jedi/jvcl/pull/128

mh

2019-05-28 22:42

reporter   ~0021851

Can be closed now as the fix for this has been merged in!

Issue History

Date Modified Username Field Change
2014-11-22 00:40 ricolebo New Issue
2014-11-22 00:40 ricolebo File Added: TJvDBComboBox.zip
2014-12-04 15:53 obones Status new => acknowledged
2019-05-20 21:40 mh Note Added: 0021847
2019-05-28 22:42 mh Note Added: 0021851
2019-05-29 10:10 obones Status acknowledged => resolved
2019-05-29 10:10 obones Fixed in Version => Daily / GIT
2019-05-29 10:10 obones Resolution open => fixed
2019-05-29 10:10 obones Assigned To => obones