View Issue Details

IDProjectCategoryView StatusLast Update
0034298LazarusLCLpublic2019-05-02 18:52
ReportermelwinekAssigned ToJesus Reyes 
PrioritynormalSeverityminorReproducibilityalways
Status assignedResolutionreopened 
Platformx86OSWindowsOS Version7
Product VersionProduct Build2.0 RC1 
Target Version2.0Fixed in Version2.1 (SVN) 
Summary0034298: Autocomplete in DBLookupComboBox
DescriptionAutocomplete in DBLookupComboBox not working
TagsNo tags attached.
Fixed in Revision59666, 59668
LazTarget2.0
Widgetset
Attached Files

Relationships

related to 0035458 assignedJesus Reyes Some data controls regressions since 1.8.x 

Activities

melwinek

2018-09-20 21:26

reporter   ~0110904

Last edited: 2018-09-21 11:41

View 2 revisions

It also does not work in trunk.

This error only occurs when:
DBLookupComboBox1.Style:=csDropDownList;

If:
DBLookupComboBox1.Style:=csDropDown;
It's good.

However, for me, this first option is more important.

melwinek

2018-10-27 13:38

reporter   ~0111613

No one else has a problem with this error?

errno

2018-10-27 15:05

reporter   ~0111615

Last edited: 2018-10-27 15:13

View 2 revisions

When DBLookupComboBox1.Style=csDropDownList , there's no edit field . You can't use autocomplete in that case .

melwinek

2018-10-27 16:59

reporter   ~0111621

In earlier versions, this worked as a search.

errno

2018-10-27 22:09

reporter   ~0111625

When DBLookupComboBox1.Style=csDropDownList and DBLookupComboBox1.sorted=true and DBLookupComboBox1 is focused , you still can make a search by typing quickly the word you want .

melwinek

2018-10-27 23:15

reporter   ~0111626

In 2.0RC1 and trunk when DBLookupComboBox1.Style=csDropDownList and DBLookupComboBox1.sorted=true and DBLookupComboBox1 is focused search by typing word not working.

melwinek

2018-11-02 09:07

reporter   ~0111741

errno can you check on 2.0RC1?

melwinek

2018-11-05 14:11

reporter  

TEST.ZIP (1,687,354 bytes)

melwinek

2018-11-05 14:12

reporter   ~0111799

Sample code and exe in attachement.

melwinek

2018-11-13 15:49

reporter   ~0111953

Today, both in RC2 and in trunk, search by typing on keyboard still does not work.

laguna

2018-11-14 09:38

reporter  

laguna

2018-11-14 09:38

reporter   ~0111964

In this version of Lazarus on Mac OSX 10.14, compiled with ppc386 and LCL cocoa, I encountered a problem in the scrolling-bar.
In particular, in the code editing window, and in the form property.

When you click on it, the screen is not updated.

wp

2018-11-14 11:39

developer   ~0111968

I can confirm (on Windows 10) that the provided demo project worked as described in v1.8.4 and even v1.4.4 (searching by typing in csDropDownList mode) - this does not work in trunk any more. This is a regression and should be fixed.

I assign this issue to Jesus Reyes who did modifications in the DBCombo/LookupComboBox infrastructure which probably are related.

melwinek

2018-11-14 13:08

reporter   ~0111970

In earlier versions there was another error:
When the combobox was closed, the mouse scroll did not scroll the dataset.
When it was open it was ok

laguna

2018-11-17 06:48

reporter  

laguna

2018-11-17 06:49

reporter   ~0112012

Last edited: 2018-11-17 07:16

View 2 revisions

MAC OSX 10.14.1 - Darkmode -COCOA
property not use color black
object ispector not select correct item

errno

2018-11-18 10:59

reporter   ~0112033

Last edited: 2018-11-19 15:16

View 6 revisions

>errno can you check on 2.0RC1?

I tested your sample project , and i confirm it doesn't work .

However the sample project $(LazarusDir)\examples\database\dblookup\project1.lpi , provided with lazarus , which uses TDBLookupComboBox components works ok .

(windows7 64bits widgetset win32/64 lazarus 32 bits trunk)

melwinek

2018-11-19 07:52

reporter   ~0112060

Last edited: 2018-11-19 07:59

View 2 revisions

I checked this example.

If Datafield and Datasource are empty then it does not work.
For me it is and must be so, I use only Listfield and Listsource.

The second thing, I do not know why it searches only the first letter of the typed text.

laguna

2018-11-19 08:19

reporter  

laguna

2018-11-19 08:20

reporter   ~0112061

O.S: MAC 10.14
Lazarus 2.0 rc last version
LCL cocoa

Not correct select object in ide form , show image
The Textbox not show point mouse for change size or select to move object.

Not select label and mouse point not select multi-object

melwinek

2018-11-22 14:45

reporter   ~0112111

Summary:
In TRUNK and in RC2 in dblookupcombobox search does not work by typing on the keyboard when dataset is null and DBLookupComboBox1.Style = csDropDownList.

I have temporarily fixed this problem for myself, replacing in a file lcl\include\dblookupcombobox.inc:

procedure TDBLookupComboBox.UTF8KeyPress(var UTF8Key: TUTF8Char);
begin
  if not FDataLink.CanModify then
    UTF8Key := '';
  inherited UTF8KeyPress(UTF8Key);
end;

to:
procedure TDBLookupComboBox.UTF8KeyPress(var UTF8Key: TUTF8Char);
begin
 // if not FDataLink.CanModify then
   // UTF8Key := '';
  inherited UTF8KeyPress(UTF8Key);
end;

Can someone finally check and fix it?

Juha Manninen

2018-11-26 10:48

developer   ~0112198

I understood this is a regression and set target to 2.0.
Jesus, can you please look at the issue.

melwinek, you could also make a proper patch:
 http://wiki.lazarus.freepascal.org/Creating_A_Patch

melwinek

2018-11-26 10:55

reporter   ~0112200

Juha Manninen:
I have too little knowledge to repair myself. This change, which I made, corrected only this error, but I do not know if what I removed is not required for other functions.

Jesus Reyes

2018-11-26 19:45

developer   ~0112212

Fixed with changes to the proposed patch, I don't think the dbcombobox reform is related to this problem, it seems to be a previous patch, probably 55911 (not really checked), which didn't account for unbound usage.

Please test.

melwinek

2018-11-26 20:45

reporter   ~0112214

dblookupcombobox.inc(46,6) Error: Identifier not found "IsUnbound"
dblookupcombobox.inc(58,28) Error: method identifier expected
dblookupcombobox.inc(60,14) Error: Identifier not found "FDataLink"
dblookupcombobox.inc(60,44) Error: Identifier not found "DataField"
dbctrls.pp(1919) Fatal: There were 4 errors compiling module, stopping
Fatal: Compilation aborted

Jesus Reyes

2018-11-26 20:54

developer   ~0112215

Sorry, I missed a change, please test again

melwinek

2018-11-26 21:06

reporter   ~0112216

Last edited: 2018-11-27 11:24

View 5 revisions

Now is good. Thank you.
Will this fix be included in version 2.0 RC3 and in the future in 2.0?

Jesus Reyes

2018-11-27 20:34

developer   ~0112236

is now queued

yusri irfani

2019-04-05 09:32

reporter   ~0115237

dblookupcombobox onChange event not working (on lazarus 2.0)

mavika

2019-04-23 10:00

reporter   ~0115744

@usri irfani: Use OnSelect event, not OnChange

@Jesus Reyes:
With unbound usage (just ListSource, KeyField and ListField assigned; DataSource and DataField not assigned)
the autocomplete is not working.

Only the first character typed in works as intended,
any other characters typed in erases the contents of the DBLookupComboBox.

(2.0.0 and 2.0.2 affected, earlier versions are working.)

mavika

2019-04-24 09:45

reporter   ~0115768

Please see attached sample project.

Tested on Windows 10 64bit (1809 build 17763.437),

Problem is present with compiler FPC 3.0.4 +
Lazarus 2.0.0 (r60307),
Lazarus 2.0.2 (r60954),
Lazarus 2.1.0 (SVN trunk r61045).

Problem was not present:
FPC 3.0.0 + Lazarus 1.6 (r51630)
FPC 3.0.4 + Lazarus 1.8.4 (r57972)

test.zip (3,867 bytes)

Jesus Reyes

2019-04-26 20:59

developer   ~0115834

Last edited: 2019-04-26 21:09

View 3 revisions

@mavika Thanks for the test and the information about the versions.
I can reproduce the problem, I have a question about how autocomplete works
I made a simple test with a standard combobox where I filled the numbers and reproduced the provided instructions with the "one" word..
while it is not a dblookupcomobobox I think that we should get the basic autocomplete functionality right or else it will be reflected in the derived components

This is what I observe after typing each character (the events are triggered in that order):

"o": OnChange: ItemIndex=-1 Text=o | OnSelect: ItemIndex=1 Text=one
"n": OnChange: ItemIndex=-1 Text=on | OnSelect: ItemIndex=1 Text=one
"e": OnChange: ItemIndex=-1 Text=one | OnSelect: --NOT TRIGGERED--

This doesn't look right to me. The typing of the "o" character matches the "one" item, itemindex=1 and is correctly set, as "one" is the second item.
but then when "n" is typed, the itemindex is again -1 yet "n" or the typed word "on" still matches the one word, Why the OnChange is triggered if
the text that the user see is still "one" (in other words, why OnChange is triggered if the text is not) also why does itemindex change?,
and worse, why is OnSelect triggered again reporting itemindex=1 if the item is already selected.
And finally when "n" is typed and "one" is fully matched and OnSelect is not triggered which is right because the item is already selected.

My guess is that once a partial match is found it should be kept until a match is refined or rejected.
I think this should be fixed first. Yet I don't know if this is the intended behavior, I would like to submit a bug report about it if necessary.

In the mean time, I think a possible fix for this problem is commenting this line:

function TDBLookupComboBox.DoEdit: boolean;
begin
  if IsUnbound then begin
    if DetectedEvents and DBCBEVENT_SELECT <>0 then begin
      //UpdateData(self); // <-- HERE
      DoOnSelect;
    end;
    if DetectedEvents and DBCBEVENT_CLOSEUP <>0 then
      DoOnCloseUp;
  end
  else
    Result := inherited DoEdit;
end;

I remember that I wrote that code trying to keep the expected behavior, which was broken by the dbcombobox reform.
but after thinking about it, I now believe that an unbound dblookupcombobox should not try update a field that is not really linked. More tests need to be made but I want to defer that until the autocomplete behavior is clarified.

mavika

2019-04-29 09:30

reporter   ~0115886

Thank you for the response and testing!

I didn't expected, that the standard combobox is also affected.
If the basic problem is here, then no wonder, it's reflected in the derived components.

Meanwhile, i modified all of my projects that use this component:
i changed the style of the DBLookupComboBox from csDropDown to csDropDownList,
doing so, the autocomplete function works again (it searches in the drop-downed-list, not in-the-box).

For me it's not a problem anymore, i like even better the csDropDownList style.

I made also further tests with this (please see attached project).

I can confirm, that commenting out the "UpdateData(self);" line in dblookupcombobox.inc file
fixes the autocomplete function (style=csDropDown), but the onChange and onSelect events are not triggered.

Offtopic: thank you and all of the other developers for all the effort in making this great software even better!

test2.zip (130,401 bytes)

Juha Manninen

2019-05-02 15:20

developer   ~0115956

I reopen this as it seems there are issues left.

Michal Gawrycki

2019-05-02 16:19

reporter   ~0115959

Please keep in mind that lookup controls require two data sources for proper operation. One for data (DataSource property) and another for lookup data (LookupSource property). Please check the attached test project (test2.zip).

test2-2.zip (3,266 bytes)

Michal Gawrycki

2019-05-02 18:52

reporter   ~0115964

I'm sorry, it looks like I made a mistake. I checked and Delphi allows this action. I'll take care of it.

Issue History

Date Modified Username Field Change
2018-09-19 08:37 melwinek New Issue
2018-09-20 21:26 melwinek Note Added: 0110904
2018-09-21 11:41 melwinek Note Edited: 0110904 View Revisions
2018-10-27 13:38 melwinek Note Added: 0111613
2018-10-27 15:05 errno Note Added: 0111615
2018-10-27 15:13 errno Note Edited: 0111615 View Revisions
2018-10-27 16:59 melwinek Note Added: 0111621
2018-10-27 22:09 errno Note Added: 0111625
2018-10-27 23:15 melwinek Note Added: 0111626
2018-11-02 09:07 melwinek Note Added: 0111741
2018-11-05 14:11 melwinek File Added: TEST.ZIP
2018-11-05 14:12 melwinek Note Added: 0111799
2018-11-13 15:49 melwinek Note Added: 0111953
2018-11-14 09:38 laguna File Added: Schermata 2018-11-13 alle 07.49.23.jpg
2018-11-14 09:38 laguna Note Added: 0111964
2018-11-14 11:39 wp Note Added: 0111968
2018-11-14 11:39 wp Assigned To => Jesus Reyes
2018-11-14 11:39 wp Status new => assigned
2018-11-14 13:08 melwinek Note Added: 0111970
2018-11-17 06:48 laguna File Added: Schermata 2018-11-17 alle 06.42.20.png
2018-11-17 06:49 laguna Note Added: 0112012
2018-11-17 07:16 laguna Note Edited: 0112012 View Revisions
2018-11-18 10:59 errno Note Added: 0112033
2018-11-18 11:00 errno Note Edited: 0112033 View Revisions
2018-11-18 11:02 errno Note Edited: 0112033 View Revisions
2018-11-18 11:02 errno Note Edited: 0112033 View Revisions
2018-11-18 11:14 errno Note Edited: 0112033 View Revisions
2018-11-19 07:52 melwinek Note Added: 0112060
2018-11-19 07:59 melwinek Note Edited: 0112060 View Revisions
2018-11-19 08:19 laguna File Added: Schermata 2018-11-19 alle 08.04.51.png
2018-11-19 08:20 laguna Note Added: 0112061
2018-11-19 15:16 errno Note Edited: 0112033 View Revisions
2018-11-22 14:45 melwinek Note Added: 0112111
2018-11-26 10:48 Juha Manninen LazTarget => 2.0
2018-11-26 10:48 Juha Manninen Note Added: 0112198
2018-11-26 10:48 Juha Manninen Target Version => 2.0
2018-11-26 10:55 melwinek Note Added: 0112200
2018-11-26 19:45 Jesus Reyes Fixed in Revision => 59666
2018-11-26 19:45 Jesus Reyes Note Added: 0112212
2018-11-26 19:45 Jesus Reyes Status assigned => resolved
2018-11-26 19:45 Jesus Reyes Fixed in Version => 2.1 (SVN)
2018-11-26 19:45 Jesus Reyes Resolution open => fixed
2018-11-26 20:45 melwinek Note Added: 0112214
2018-11-26 20:54 Jesus Reyes Note Added: 0112215
2018-11-26 21:06 melwinek Note Added: 0112216
2018-11-26 21:12 melwinek Note Edited: 0112216 View Revisions
2018-11-26 21:14 melwinek Note Edited: 0112216 View Revisions
2018-11-26 21:15 melwinek Note Edited: 0112216 View Revisions
2018-11-27 11:24 melwinek Note Edited: 0112216 View Revisions
2018-11-27 20:34 Jesus Reyes Note Added: 0112236
2019-03-06 21:21 Jesus Reyes Fixed in Revision 59666 => 59666, 59668
2019-04-05 09:32 yusri irfani Note Added: 0115237
2019-04-23 10:00 mavika Note Added: 0115744
2019-04-24 09:45 mavika File Added: test.zip
2019-04-24 09:45 mavika Note Added: 0115768
2019-04-26 20:59 Jesus Reyes Note Added: 0115834
2019-04-26 21:01 Jesus Reyes Note Edited: 0115834 View Revisions
2019-04-26 21:09 Jesus Reyes Note Edited: 0115834 View Revisions
2019-04-29 09:30 mavika File Added: combobox_events_triggered.png
2019-04-29 09:30 mavika File Added: test2.zip
2019-04-29 09:30 mavika Note Added: 0115886
2019-05-02 15:09 Juha Manninen Relationship added related to 0035458
2019-05-02 15:20 Juha Manninen Status resolved => assigned
2019-05-02 15:20 Juha Manninen Resolution fixed => reopened
2019-05-02 15:20 Juha Manninen Note Added: 0115956
2019-05-02 16:19 Michal Gawrycki File Added: test2-2.zip
2019-05-02 16:19 Michal Gawrycki Note Added: 0115959
2019-05-02 18:52 Michal Gawrycki Note Added: 0115964