View Issue Details

IDProjectCategoryView StatusLast Update
0033428LazarusLCLpublic2018-03-14 14:14
ReporterTony WhymanAssigned To 
PrioritynormalSeverityminorReproducibilityalways
Status newResolutionopen 
Platformx86_54OSLInuxOS VersionMint 18
Product VersionProduct Build 
Target VersionFixed in Version 
Summary0033428: TDBLookup does not handle the deLayoutChanged event
DescriptionTDBLookup supports the TDBLookupComboBox. A deLayoutChanged event typically occurs when TDataSet.EnableControls is called and (e.g.) the dataset has been closed and re-opened while control events were disabled.

If the ListSource.DataSet is closed and re-opened while control events are disabled then the combobox text is not updated when control events are enabled given that TDBLookup does not handle the deLayoutChanged event and the combobox may appear blank.
Additional InformationAttached patch reacts to a deLayoutChanged event by calling the owning TDBLookupComboBox UpdateLookup event. This refreshes the control.
TagsNo tags attached.
Fixed in Revision
LazTarget
Widgetset
Attached Files
  • dblookup.patch (714 bytes)
    Index: lcl/include/dblookup.inc
    ===================================================================
    --- lcl/include/dblookup.inc	(revision 10748)
    +++ lcl/include/dblookup.inc	(working copy)
    @@ -62,6 +62,7 @@
         FRecordUpdated: Boolean;
       protected
         procedure ActiveChanged; override;
    +    procedure LayoutChanged; override;
         procedure DataEvent(Event: TDataEvent; Info: Ptrint); override;
       public
         constructor Create(Lookup: TDBLookup);
    @@ -75,6 +76,11 @@
       FLookup.ActiveChange(Self);
     end;
     
    +procedure TDBLookupDataLink.LayoutChanged;
    +begin
    +  TDBLookupComboBox(FLookup.Owner).UpdateLookup;
    +end;
    +
     procedure TDBLookupDataLink.DataEvent(Event: TDataEvent; Info: Ptrint);
     var
       I: Integer;
    
    dblookup.patch (714 bytes)

Activities

Tony Whyman

2018-03-14 13:15

reporter  

dblookup.patch (714 bytes)
Index: lcl/include/dblookup.inc
===================================================================
--- lcl/include/dblookup.inc	(revision 10748)
+++ lcl/include/dblookup.inc	(working copy)
@@ -62,6 +62,7 @@
     FRecordUpdated: Boolean;
   protected
     procedure ActiveChanged; override;
+    procedure LayoutChanged; override;
     procedure DataEvent(Event: TDataEvent; Info: Ptrint); override;
   public
     constructor Create(Lookup: TDBLookup);
@@ -75,6 +76,11 @@
   FLookup.ActiveChange(Self);
 end;
 
+procedure TDBLookupDataLink.LayoutChanged;
+begin
+  TDBLookupComboBox(FLookup.Owner).UpdateLookup;
+end;
+
 procedure TDBLookupDataLink.DataEvent(Event: TDataEvent; Info: Ptrint);
 var
   I: Integer;
dblookup.patch (714 bytes)

Issue History

Date Modified Username Field Change
2018-03-14 13:15 Tony Whyman New Issue
2018-03-14 13:15 Tony Whyman File Added: dblookup.patch
2018-03-14 14:14 Marco van de Voort Project FPC => Lazarus