Index: VerpakkingsDefinitie/UI/GevondenProductenScherm.pas =================================================================== diff -u -r567 -r570 --- VerpakkingsDefinitie/UI/GevondenProductenScherm.pas (.../GevondenProductenScherm.pas) (revision 567) +++ VerpakkingsDefinitie/UI/GevondenProductenScherm.pas (.../GevondenProductenScherm.pas) (revision 570) @@ -11,9 +11,6 @@ Subscherm, ProductsAgent, Main, ApplicationContext; -const - GridColNamen: array [1 .. 5] of string = ('Naam', 'Nummer', 'Stock', '', ''); - type TFormGevondenProducten = class(TFormSubscherm) ListViewProducten: TListView; @@ -51,16 +48,6 @@ ColNaam: string; begin FProductSubject.RegisterObserver(FSubjectObserver); - - for ColNaam in GridColNamen do - begin - with ListViewProducten.Columns.Add do - begin - Caption := ColNaam; - Alignment := taLeftJustify; - Width := -1; - end; - end; end; procedure TFormGevondenProducten.FormDestroy(Sender: TObject); @@ -75,11 +62,9 @@ if Item.Data = nil then exit; ApplicationContext.ProductDetailContext.GeselecteerdProduct := Item.Data; + ApplicationContext.ProductDetailContext.NotifyChanged(); FProductsAgent.ZoekProductDataMetProductNr(TProductInformatie(Item.Data).ProductNr, self.ApplicationContext.UserContext, self.ApplicationContext.ProductDetailContext); - - ApplicationContext.ProductDetailContext.NotifyChanged(); - end; procedure TFormGevondenProducten.UpdateGui(Sender: TObject); @@ -102,6 +87,8 @@ end; end; + // Bij opnieuw inladen is de selectie verloren gegaan. + self.ApplicationContext.ProductDetailContext.ResetSelectie(); end; end.