View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0001678 | JEDI VCL | 00 JVCL Components | public | 2004-04-21 04:00 | 2004-04-22 23:39 |
Reporter | hamilton | Assigned To | user72 | ||
Priority | normal | Severity | minor | Reproducibility | always |
Status | resolved | Resolution | fixed | ||
Product Version | |||||
Target Version | Fixed in Version | ||||
Summary | 0001678: JvDBLookupCombo does not perform case insensitive search | ||||
Description | I am placing a JvDBLookupCombo on a form and assigning just the datasource and datafield properties to display a fkLookup field of a ClientDataSet. Changing the value of the IgnoreCase property has no effect. | ||||
Additional Information | This behaviour is replicable using code from 2004-04-21 | ||||
Tags | No tags attached. | ||||
|
The problem seems to be associated with TJvLocateObject.Locate, s0 could you set a breakpoint at the first line and step through the code to see where it goes south? |
|
Your lead turned out to be correct, the problem was in the Locate method. The dataset field I was testing with is of type ftWideString rather than ftString that Locate expected. The line that needs to be changed in TJvLocateObject.Locate is: if FLookupField.DataType <> ftString then It needs to be replaced with: if not ((FLookupField.DataType = ftString) or (FLookupField.DataType = ftWideString)) then |
|
I made a slightly different change to make it easier to add new types if necessary: function TJvLocateObject.Locate(const KeyField, KeyValue: string; Exact, CaseSensitive: Boolean): Boolean; var LookupKey: TField; function IsStringType(FieldType:TFieldType):boolean; const cStringTypes = [ftString, ftWideString]; begin Result := FieldType in cStringTypes; end; begin if DataSet = nil then begin Result := False; Exit; end; DataSet.CheckBrowseMode; LookupKey := DataSet.FieldByName(KeyField); DataSet.CursorPosChanged; FLookupField := LookupKey; FLookupValue := KeyValue; FLookupExact := Exact; FCaseSensitive := CaseSensitive; if not IsStringType(FLookupField.DataType) then begin FCaseSensitive := True; try CheckFieldType(FLookupField); except Result := False; Exit; end; end else FCaseSensitive := CaseSensitive; FBookmark := DataSet.GetBookmark; try DataSet.DisableControls; try Result := MatchesLookup(FLookupField); if not Result then begin if UseKey then Result := LocateKey else begin if FilterApplicable then Result := LocateFilter else Result := LocateFull; end; if not Result then SetToBookmark(DataSet, FBookmark); end; finally DataSet.EnableControls; end; finally FLookupValue := EmptyStr; FLookupField := nil; DataSet.FreeBookmark(FBookmark); FBookmark := nil; end; end; Updated in CVS |
Date Modified | Username | Field | Change |
---|---|---|---|
2004-04-21 04:00 | hamilton | New Issue | |
2004-04-22 00:04 |
|
Note Added: 0003984 | |
2004-04-22 00:04 |
|
Status | new => feedback |
2004-04-22 07:35 | hamilton | Note Added: 0004008 | |
2004-04-22 23:39 |
|
Status | feedback => resolved |
2004-04-22 23:39 |
|
Resolution | open => fixed |
2004-04-22 23:39 |
|
Assigned To | => user72 |
2004-04-22 23:39 |
|
Note Added: 0004020 |