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
0001677 [JEDI VCL] 00 JVCL Components major always 2004-04-21 04:00 2005-04-12 08:50
Reporter hamilton View Status public  
Assigned To obones
Priority normal Resolution fixed  
Status resolved   Product Version
Summary 0001677: JvDBLookupCombo does not update text when changed
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.

The text displayed in the edit portion of the control remains unchanged when I select a new value from the drop down list. However, scrolling to another record and then back again shows that the dataset has actually been updated because the text is now correct.
Additional Information This behaviour is replicable using code from 2004-04-21
Tags No tags attached.
Attached Files

- Relationships

-  Notes
(0003987)
user72
2004-04-22 00:23

Have you tried debugging it to find the cause of the problem?
(0004002)
hamilton (reporter)
2004-04-22 05:27

point taken. i will look into it.
(0004013)
user72
2004-04-22 09:01

Thanks, I am a bit busy at the moment :)
(0004015)
hamilton (reporter)
2004-04-22 13:06

Stepping through JvDBLookupCombo.CloseUp is interesting. SelectKeyValue is called by CloseUp and LookupList mouse events in an erratic order, so the SelectKeyValue that CloseUp tries to assign is sometimes wrong before it starts and other times sets the correct value only to have something else reset it. I spent some time on this and didn't get too far :(
(0004034)
user72
2004-04-23 06:16

I'll see if I can find some time to look into this during the weekend.
(0004364)
hamilton (reporter)
2004-05-26 11:51

It appears someone has fixed this control. I can't find a bugnote describing the fix or who did it, but the latest code works. Thanks :)
(0004368)
user72
2004-05-26 23:51

Could it be related to 0001678?
(0004375)
hamilton (reporter)
2004-05-27 08:27

Hmmm, the news is not as good as i had hoped.

The JvDBLookupCombo does not work when the DataSource/DataField are used (ie when a lookup field is displayed).

However the control DOES work if the ListSource/ListField are used (as if the control were used to control the master in a master/detail relationship).

I have traced through the code and observe that the correct text is displayed for an instant after the a combo item is selected, then the original text is drawn back again. The actual item selected does change, it is just the display that is wrong. There is some thread that restores the old display value. I found that if I put a breakpoint in at some locations and waited for a couple of seconds the control then worked.

Also, I don't believe this is related to 0001678?

I will provide additional information / assistance isolating the problem if you are unable to replicate it. Let me know.
(0004891)
obones (administrator)
2004-08-03 07:31

Please provide us with more details, especially after having tested with the latest JCL/JVCL available here:

http://jvcl.sf.net/daily/ [^]
http://jcl.sf.net/daily/ [^]
(0004959)
hamilton (reporter)
2004-08-07 03:32

I just downloaded the latest code, will test it tomorrow. Thanks for the interest :)
(0004966)
hamilton (reporter)
2004-08-08 02:06

The problem is still there in the latest source. I tested on Delphi 7.1 with JCL and JVCL downloaded on Saturday 2004-08-07.

Steps to reproduce:

1. Setup a lookup relationship in a database
   a. Create 2 tables in a database, call them Dogs and DogTypes
   b. Add a field called KeyID of type AutoInc to both tables
   c. Add a field called Name of type string to both tables
   d. Add a field called TypeID of type integer to Dogs.
   e. Put some data in the tables
2. Setup delphi datasets
   a. Add ADOTables (or whatever) for the two tables.
   b. Add a datasource for the dogs table, called DogsDataSource
   c. Add all fields to both tables.
   d. Additionally, add a lookup field to the Dogs table, called DogTypeName
      that links TypeID in Dogs to KeyID in DogType
3. Setup a form to display the data
   a. Add a DBGrid, DBLookupComboBox and JvDBLookupCombo to a form.
   b. Make DogDataSource the DataSource for all 3 DB components.
   c. Make DogTypeName the datafield for the 2 combo boxes.
   d. Add fields to the DBGrid, show the Name and DogTypeName
4. Run the app
   a. Changing the selected item in the JvDBLookupCombo does NOT work.
      ie Try picking something in the list. The item you select is actually
         displayed for a fraction of a second before the old value is redrawn.

Ok, that was a bit wordy, but I am sure you follow my meaning. It is easy to see that the DBComboBox works fine, but the Jedi equivalent is unusable.

The problem is limited to using the control to display lookup fields. The following features DO work:
1. Scrolling through the DBGrid DOES update the displayed value in the JvDBLookup.
2. Using the ListSource and ListField (in other circumstances) does work.
ie If the JvDBLookupComobo is used to display DogTypes, the grid to display Dogs and the MasterSource, etc of Dogs is setup properly then the JvDBLookup DOES work.

Let me know if you are unable to reproduce this error. I will upload sample code and/or database upon request. Cheers.
(0005660)
obones (administrator)
2004-11-19 00:57

Hi.
Could you please try with the latest daily zips available here:

http://jvcl.sf.net/daily/ [^]
http://jcl.sf.net/daily/ [^]

If the problem is not fixed, please post a test project.

Thanks
(0006972)
obones (administrator)
2005-04-12 08:50

No answers, this is assumed to be fixed.

- Issue History
Date Modified Username Field Change
2004-04-21 04:00 hamilton New Issue
2004-04-21 04:03 hamilton Issue Monitored: hamilton
2004-04-22 00:23 user72 Note Added: 0003987
2004-04-22 00:23 user72 Status new => feedback
2004-04-22 05:27 hamilton Note Added: 0004002
2004-04-22 09:01 user72 Note Added: 0004013
2004-04-22 13:06 hamilton Note Added: 0004015
2004-04-23 06:16 user72 Note Added: 0004034
2004-05-26 11:51 hamilton Note Added: 0004364
2004-05-26 23:51 user72 Note Added: 0004368
2004-05-27 08:27 hamilton Note Added: 0004375
2004-08-03 07:31 obones Note Added: 0004891
2004-08-07 03:28 anonymous Note Added: 0004958
2004-08-07 03:32 hamilton Note Added: 0004959
2004-08-07 05:14 user72 Note Deleted: 0004958
2004-08-08 02:06 hamilton Note Added: 0004966
2004-11-19 00:57 obones Note Added: 0005660
2005-04-12 08:50 obones Status feedback => resolved
2005-04-12 08:50 obones Resolution open => fixed
2005-04-12 08:50 obones Assigned To => obones
2005-04-12 08:50 obones Note Added: 0006972


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