Project JEDI - Issue Tracker
Mantis Bugtracker

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0006620 [JEDI VCL] 00 JVCL Components major always 2018-02-19 22:14 2018-02-19 22:14
Reporter dougwoodrow View Status public  
Assigned To
Priority normal Resolution open  
Status new   Product Version 3.48
Summary 0006620: TJvDBLookupCombo.IgnoreCase property is applied to the key lookup
Description According to the wiki the TJvDBLookupCombo.IgnoreCase property specifies the case-sensitivity of the incremental search:
http://wiki.delphi-jedi.org/wiki/JVCL_Help:TJvDBLookupCombo.IgnoreCase [^]

In the current implementation this property is applied to the key LookupField as well as to the LookupDisplay field.

In my opinion this is a bug, as it can cause the wrong record to be displayed when the key field is case-sensitive.

For instance, with the following example table, a single character key field 'a' will be incorrectly displayed as "Item one" instead of "Item three" when the IgnoreCase property is set to True.

|Key|Description|
|---|-----------|
| A |Item one |
| B |Item two |
| a |Item three |
Additional Information Example (quick-and-dirty) fix:

function TJvLookupControl.Locate(const SearchField: TField;
  const AValue: string; Exact: Boolean): Boolean;
var
  IsDisplayField: Boolean;
  CaseSensitive: Boolean;
begin
  FLocate.IndexSwitch := FIndexSwitch;
  Result := False;
  try
    if not ValueIsEmpty(AValue) and (SearchField <> nil) then
    begin
      IsDisplayField := (SearchField = FDisplayField);
      if IsDisplayField then
        // respect lookup property
        CaseSensitive := not IgnoreCase
      else
        // not display, so this is the key field, do a case-sensitive locate
        CaseSensitive := True;
      Result := FLocate.Locate(SearchField.FieldName, AValue, Exact, CaseSensitive, True, RightTrimmedLookup);
      if Result then
      begin
        if IsDisplayField then
          FValue := FKeyField.AsString;
        UpdateDisplayValue;
      end;
    end;
  except
  end;
end;
Tags No tags attached.
Attached Files

- Relationships

There are no notes attached to this issue.

- Issue History
Date Modified Username Field Change
2018-02-19 22:14 dougwoodrow New Issue


Mantis 1.1.6[^]
Copyright © 2000 - 2008 Mantis Group
Powered by Mantis Bugtracker