aurelioset Posted October 17, 2020 Share Posted October 17, 2020 hi, how can i clear a UnimFieldSet and write again? this is my code. procedure TPrincipal.Listagem; var FrameSoma : TFFrameProduto; item : TUnimFieldContainer; i,EOF : Integer; begin eof := MainModule.UniMainModule.DataSourceProd.DataSet.RecordCount; MainModule.UniMainModule.DataSourceProd.DataSet.First; try UnimFieldSet1.BeginUpdate; for I := 1 to eof do begin FrameSoma := TFFrameProduto.Create(self); item := TUnimFieldContainer.Create(self); FrameSoma.Name := 'frame'+ I.ToString; FrameSoma.Parent := item; // item.Height := 50; //item.Width := FPrincipal.Width; FrameSoma.UnimLabel1.Caption := (MainModule.UniMainModule.FDQProd.FieldByName('produto').AsString); FrameSoma.UnimImage1.Picture.LoadFromFile(MainModule.UniMainModule.FDQProd.FieldByName('imagem').AsString); FrameSoma.UnimLabel2.Caption := 'Valor '+(MainModule.UniMainModule.FDQProd.FieldByName('Valor').AsString); FrameSoma.UnimLabel3.Caption := (MainModule.UniMainModule.FDQProd.FieldByName('Descricao').AsString); item.Parent := UnimFieldSet1; begin MainModule.UniMainModule.DataSourceProd.DataSet.Next; UnimFieldSet1.EndUpdate; end; end; Except end end; Quote Link to comment Share on other sites More sharing options...
aurelioset Posted October 17, 2020 Author Share Posted October 17, 2020 sorry my poor english Quote Link to comment Share on other sites More sharing options...
Sherzod Posted October 17, 2020 Share Posted October 17, 2020 Hello, Can you please specify which editon and build of UniGUI are you using? Quote Link to comment Share on other sites More sharing options...
aurelioset Posted October 17, 2020 Author Share Posted October 17, 2020 hi Sherzod, I'm using unigui 1.90.0.1530. I am trying to solve the problem with this code. procedure TPrincipal.ApagarLista; var i,EOF : Integer; Campo: TComponent; begin eof := MainModule.UniMainModule.DataSourceProd.DataSet.RecordCount; MainModule.UniMainModule.DataSourceProd.DataSet.First; try for I := 0 to eof do begin Campo := FindComponent('frame'+ I.ToString); if not (Campo = nil) then begin Campo.Free; end; end; MainModule.UniMainModule.DataSourceProd.DataSet.Next; finally begin UnimFieldSet1.Container.RemoveAll; end; end; end; Quote Link to comment Share on other sites More sharing options...
Sherzod Posted October 17, 2020 Share Posted October 17, 2020 7 minutes ago, aurelioset said: I'm using unigui 1.90.0.1530 Hi, Are you using a trial edition? Quote Link to comment Share on other sites More sharing options...
aurelioset Posted October 17, 2020 Author Share Posted October 17, 2020 no, I was having trouble cleaning up the creation of a component (parent), I believe it worked! thank you very much Sherzod. it's 2:15am here, I'm already very tired Quote Link to comment Share on other sites More sharing options...
Sherzod Posted October 17, 2020 Share Posted October 17, 2020 4 hours ago, aurelioset said: no Please adjust your forum email address: And you can attach a simple testcase to check. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.