erich.wanker Posted April 27, 2013 Posted April 27, 2013 Hello peoples, i have a little question: in TUniMainModule i hve my querys.. procedure TUniMainModule.ZQuery2AfterScroll(DataSet: TDataSet); begin UniMainModule.ZQuery3.SQL.Clear; UniMainModule.ZQuery3.SQL.Append('SELECT * FROM DB_TAETIGKEIT'); UniMainModule.ZQuery3.Active:=true; main.MainForm.erzeugePanel; end; and in TMainForm i have the panel-create thing... var meinpanel:TUniPanel; procedure TMainForm.erzeugePanel; var i:Integer; begin while not UniMainModule.ZQuery3.Eof do begin i:= UniMainModule.ZQuery3.FieldByName('INR').AsInteger; meinpanel:=TUniPanel.Create(self); meinpanel.Parent:=unipanel3; meinpanel.Caption:='ID: '+inttostr(i); meinpanel.Align:=alTop; meinpanel.Height:=12; meinpanel.Tag:=i; meinpanel.OnClick:=meinPanelsClick; UniMainModule.ZQuery3.Next; end; //eof end; if i start the webapp i get a lot of errors ... please have a look at the attached image how can i solve this? Thank you Erich Quote
Administrators Farshad Mohajeri Posted April 27, 2013 Administrators Posted April 27, 2013 AfterScroll is called many many times when user scrolls in the dataset and you are creating several panels here at runtime. It is not a good practice at all. Try creating the panels in a button click event instead of AfterScroll and see if same thing happens. If it doesn't help then please send a test case. Quote
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.