View Issue Details

IDProjectCategoryView StatusLast Update
0005190JEDI VCL00 JVCL Componentspublic2011-06-10 16:09
ReporterThorAssigned ToAHUser 
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Product VersionDaily / GIT 
Target VersionFixed in Version3.40 
Summary0005190: jvDBlookup don't refresh displayValue when lookupindex is the same value of the previous
DescriptionSuppose you browse a table1 that is master for a table2. Table2 is master for table3.
You have a jvDBlookup with use table1 as datasource and a field from table1 as datafield. The same jvDBlookup use Table3 as lookupsource + a field as lookupindex and another field as lookupdisplay.
When you browse the table1 this change also table2 and table3 but if
the value for the field lookupindex and datafield is the same as the previous,
the lookupdisplay don't change !
I've tryed to force the display in the following way (on an event of record change of the first table) but none of this worked :
// DBLCindc.Refresh;
// DBLCindc.Realign;
// DBLCindc.Repaint;
// DBLCindc.Update;
// DBLCindc.ResetField;
// DBLCindc.DisplayValue:=IFAT.Tindc.fieldbyname('indirizzo').asstring;
P.S: DBLCindc is the TjvDBlookup

Solved with the following new method in the class and calling (DBLCindc.ForceDisplay;) in the event record change

Below the patch with the current SVN.
If you find a way to automate the display change without calling "ForceDisplay" is welcome ;-)
Additional InformationIndex: JvDBLookup.pas
===================================================================
--- JvDBLookup.pas (revision 12372)
+++ JvDBLookup.pas (working copy)
@@ -447,6 +447,7 @@
     procedure CloseUp(Accept: Boolean); dynamic;
     procedure DropDown; virtual;
     procedure ResetField; override;
+ procedure ForceDisplay;
     property IsDropDown: Boolean read FListVisible;
     property ListVisible: Boolean read FListVisible;
     property Text: string read GetText;
@@ -2818,6 +2819,14 @@
   Result := inherited Text;
 end;
 
+procedure TJvDBLookupCombo.ForceDisplay;
+begin
+ ListLinkActiveChanged;
+ if FListActive then
+ DataLinkRecordChanged(nil);
+ DisplayValueChanged;
+end;
+
 procedure TJvDBLookupCombo.InvalidateText;
 var
   R: TRect;
TagsNo tags attached.

Relationships

parent of 0005207 resolvedAHUser stack overflow testing sample of issue 0005190 
related to 0005521 resolvedobones bug 5190 reappeared from revision 12821 (jvDBlookup don't refresh displayValue when lookupindex is the same value of the previou 

Activities

Thor

2010-03-08 12:15

reporter   ~0017235

Sorry for the mismatch read JvDBLookupCombo where jvDBlookup ... can't find
where to modify the report

obones

2010-03-09 12:09

administrator   ~0017282

Please provide the zipped sources of a sample application showing this

2010-03-09 16:50

 

testLookupCombo.zip (514,825 bytes)

Thor

2010-03-09 16:52

reporter   ~0017297

Source and exe with the Button and the new "procedure".
Try browsing forward and back. The code "2" have different city for every name
but the lookupCombo don't change the display value.

AHUser

2010-03-16 23:03

developer   ~0017308

Fixed in SVN.

The JvDBLookup control now updates automatically.

Issue History

Date Modified Username Field Change
2010-03-08 12:10 Thor New Issue
2010-03-08 12:15 Thor Note Added: 0017235
2010-03-09 12:09 obones Note Added: 0017282
2010-03-09 12:09 obones Status new => feedback
2010-03-09 16:50 Thor File Added: testLookupCombo.zip
2010-03-09 16:52 Thor Note Added: 0017297
2010-03-16 23:03 AHUser Note Added: 0017308
2010-03-16 23:03 AHUser Status feedback => resolved
2010-03-16 23:03 AHUser Fixed in Version => Daily / SVN
2010-03-16 23:03 AHUser Resolution open => fixed
2010-03-16 23:03 AHUser Assigned To => AHUser
2010-03-24 18:59 outchy Relationship added parent of 0005207
2011-06-10 16:09 obones Fixed in Version Daily / SVN => 3.40
2012-02-27 16:59 obones Relationship added related to 0005521