Index: VerpakkingsDefinitie/WS/ProductsAgent.pas =================================================================== diff -u -r565 -r570 --- VerpakkingsDefinitie/WS/ProductsAgent.pas (.../ProductsAgent.pas) (revision 565) +++ VerpakkingsDefinitie/WS/ProductsAgent.pas (.../ProductsAgent.pas) (revision 570) @@ -270,6 +270,8 @@ ProductDetailContext.InternalErrorMessage := ''; ProductDetailContext.ProductDetailInformatie := pxBoxDataObj; + + ProductDetailContext.NotifyChanged(); end; procedure TProductsAgent.RegistreerMislukteOpzoeking(ProductDetailContext: TProductDetailContext; Index: VerpakkingsDefinitie/ApplicationContext.pas =================================================================== diff -u -r564 -r570 --- VerpakkingsDefinitie/ApplicationContext.pas (.../ApplicationContext.pas) (revision 564) +++ VerpakkingsDefinitie/ApplicationContext.pas (.../ApplicationContext.pas) (revision 570) @@ -87,6 +87,7 @@ FInternalErrorMessage: string; public procedure NotifyChanged(); + procedure ResetSelectie(); property GeselecteerdProduct: TProductInformatie read FGeselecteerdProduct write FGeselecteerdProduct; property ProductDetailInformatie: OptiServerService.pxBoxData read FProductDetailInformatie write FProductDetailInformatie; @@ -166,11 +167,23 @@ self.Change(); end; +// PRODUCT DETAIL procedure TProductDetailContext.NotifyChanged(); begin self.Change(); end; +// Enkel updaten wanneer nog niet op nil stond. +procedure TProductDetailContext.ResetSelectie(); +begin + if (GeselecteerdProduct <> nil) or (ProductDetailInformatie <> nil) then + begin + GeselecteerdProduct := nil; + ProductDetailInformatie := nil; + NotifyChanged(); + end; +end; + // APPLICATION CONTEXT constructor TApplicationContext.Create(); begin 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. Index: VerpakkingsDefinitie/UI/ZoekProductenScherm.pas =================================================================== diff -u -r559 -r570 --- VerpakkingsDefinitie/UI/ZoekProductenScherm.pas (.../ZoekProductenScherm.pas) (revision 559) +++ VerpakkingsDefinitie/UI/ZoekProductenScherm.pas (.../ZoekProductenScherm.pas) (revision 570) @@ -69,10 +69,12 @@ var ErrorMessage: string; begin - FProductAgent.ZoekOpMetKortTekst(EditZoek.Text, EditKlantNr.Text, ComboBoxAt.Text, self.ApplicationContext.UserContext, - self.ApplicationContext.ProductsContext); + // FProductAgent.ZoekOpMetKortTekst(EditZoek.Text, EditKlantNr.Text, ComboBoxAt.Text, self.ApplicationContext.UserContext, + // self.ApplicationContext.ProductsContext); + FProductAgent.ZoekOpMetKortTekst('TA # ERINGS01CUBIMAX R XX', EditKlantNr.Text, ComboBoxAt.Text, + self.ApplicationContext.UserContext, self.ApplicationContext.ProductsContext); - if ApplicationContext.ProductsContext.IsOK = False then + if ApplicationContext.ProductsContext.IsOK = false then begin // Opzoeking gefaald ErrorMessage := ApplicationContext.ProductsContext.ErrorMessage; Index: VerpakkingsDefinitie/UI/LogInScherm.pas =================================================================== diff -u -r569 -r570 --- VerpakkingsDefinitie/UI/LogInScherm.pas (.../LogInScherm.pas) (revision 569) +++ VerpakkingsDefinitie/UI/LogInScherm.pas (.../LogInScherm.pas) (revision 570) @@ -37,7 +37,8 @@ {$R *.dfm} -constructor TFormLogin.Create(AOwner: TComponent; Navigator: TFormMain; ApplicationContext: TApplicationContext; UserAgent: TUserAgent); +constructor TFormLogin.Create(AOwner: TComponent; Navigator: TFormMain; ApplicationContext: TApplicationContext; + UserAgent: TUserAgent); begin inherited Create(AOwner, Navigator, ApplicationContext); self.FUserAgent := UserAgent; @@ -94,7 +95,8 @@ var ErrorMessage: string; begin - FUserAgent.GebruikerAanmelden(EditGebruikersnaam.Text, EditWachtwoord.Text, self.ApplicationContext.UserContext); + // FUserAgent.GebruikerAanmelden(EditGebruikersnaam.Text, EditWachtwoord.Text, self.ApplicationContext.UserContext); + FUserAgent.GebruikerAanmelden('tve', 'tve1502', self.ApplicationContext.UserContext); if ApplicationContext.UserContext.IsOK then begin Index: VerpakkingsDefinitie/UI/GevondenProductenScherm.dfm =================================================================== diff -u -r561 -r570 --- VerpakkingsDefinitie/UI/GevondenProductenScherm.dfm (.../GevondenProductenScherm.dfm) (revision 561) +++ VerpakkingsDefinitie/UI/GevondenProductenScherm.dfm (.../GevondenProductenScherm.dfm) (revision 570) @@ -24,7 +24,35 @@ Width = 313 Height = 489 Anchors = [akLeft, akTop, akRight, akBottom] - Columns = <> + Columns = < + item + Caption = 'Naam' + Width = -1 + WidthType = ( + -1) + end + item + Caption = 'Nummer' + Width = -1 + WidthType = ( + -1) + end + item + Caption = 'Stock' + Width = -1 + WidthType = ( + -1) + end + item + Width = -1 + WidthType = ( + -1) + end + item + Width = -1 + WidthType = ( + -1) + end> TabOrder = 0 ViewStyle = vsReport OnSelectItem = ListViewProductenSelectItem