Index: VerpakkingsDefinitie/UI/ProductDetailScherm.pas =================================================================== diff -u -r591 -r593 --- VerpakkingsDefinitie/UI/ProductDetailScherm.pas (.../ProductDetailScherm.pas) (revision 591) +++ VerpakkingsDefinitie/UI/ProductDetailScherm.pas (.../ProductDetailScherm.pas) (revision 593) @@ -5,7 +5,7 @@ uses Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, System.Generics.Collections, Vcl.ExtCtrls, - Subscherm, Main, + Subscherm, Navigator, ApplicationContext, ObserverPattern, Vcl.ComCtrls, Vcl.CheckLst, CheckCombo; @@ -95,7 +95,6 @@ procedure TFormProductDetail.FormCreate(Sender: TObject); begin - FProductDetailsSubject.RegisterObserver(FProductDetailsSubjectObserver); // Vervang sommige comboboxen door TCheckedComboBox CheckComboBoxPositie := TCheckedComboBox.Create(self); with CheckComboBoxPositie do @@ -106,6 +105,9 @@ with CheckComboBoxRichting do CheckComboBoxRichting.Delimiter := ';'; TUtil.VervangControl(ComboBoxRichting, CheckComboBoxRichting); + + // Registreer bij observer + FProductDetailsSubject.RegisterObserver(FProductDetailsSubjectObserver); end; procedure TFormProductDetail.FormDestroy(Sender: TObject); @@ -127,8 +129,7 @@ VorigeIndexInList: Integer; begin GeselecteerdProduct := ApplicationContext.ProductsContext.GeselecteerdProduct; - if (GeselecteerdProduct = nil) or - (ApplicationContext.ProductVerpakkingContext.ProductVerpakkingen.Count = 0) then + if (GeselecteerdProduct = nil) or (ApplicationContext.ProductVerpakkingContext.ProductVerpakkingen.Count = 0) then begin UpdateGuiDataAanwezigheid(False); exit; @@ -229,7 +230,7 @@ EditAantal.Text := ProductVerpakking.Aantal; // Parameters - TUtil.FreeControlChildrenDeep(ScrollBoxParameters); + TUtil.FreeControlChildren(ScrollBoxParameters); for Parameter in ProductVerpakking.Parameters do begin NieuweParameterControl := TCustomPanelVerpakkingParameter.Create(ScrollBoxParameters);