erich.wanker Posted July 30, 2013 Posted July 30, 2013 Hello, in Webmode - the TUniMainModule.OBJEKTAfterScroll - Message ist send multi times.. Is it a bug or did i something wrong ? i have 3 tabel and 3 grids - every table has a "afterScroll".. If you select a row in PERSON : TUniMainModule.PERSON AfterScroll -> SELECT * FROM VERTRAG TUniMainModule.VERTRAG AfterScroll -> SELECT * FROM OBJEKT TUniMainModule.OBJEKT AfterScroll -> uniMEMO.lines.append - 4 Events will be create ! Please have a look at the attached images of a small demo - i named the images with informations. i have: Main Mainmodule Servermodule Main: implementation {$R *.dfm} uses uniGUIVars, MainModule, uniGUIApplication,ServerModule; function MainForm: TMainForm; begin Result := TMainForm(UniMainModule.GetFormInstance(TMainForm)); end; procedure TMainForm.UniFormShow(Sender: TObject); begin UniMainModule.ZConnection1.Connect; UniMainModule.PERSON.SQL.Clear; UniMainModule.PERSON.SQL.add('SELECT * FROM PERSON '); UniMainModule.PERSON.Open; end; initialization RegisterMainFormClass(TMainForm); end. Mainmodule: implementation {$R *.dfm} uses UniGUIVars, ServerModule, uniGUIApplication, main; function UniMainModule: TUniMainModule; begin Result := TUniMainModule(UniApplication.UniMainModule) end; procedure TUniMainModule.OBJEKTAfterScroll(DataSet: TDataSet); begin main.MainForm.UniMemo1.Lines.Append(timetostr(now)); end; procedure TUniMainModule.PERSONAfterScroll(DataSet: TDataSet); begin VERTRAG.SQL.Clear; VERTRAG.SQL.add('SELECT * FROM VERTRAG WHERE ID_PERSON = '+PERSON.fieldbyName('ID_PERSON').AsString); VERTRAG.Open; end; procedure TUniMainModule.VERTRAGAfterScroll(DataSet: TDataSet); begin if (VERTRAG.RecordCount > 0) then begin OBJEKT.SQL.Clear; OBJEKT.SQL.add('SELECT * FROM OBJEKT WHERE ID_VERTRAG = '+VERTRAG.fieldbyName('ID_VERTRAG').AsString); OBJEKT.Open; end else begin OBJEKT.SQL.Clear; OBJEKT.SQL.add('SELECT * FROM OBJEKT WHERE ID_VERTRAG = -1'); OBJEKT.Open; end; end; initialization RegisterMainModuleClass(TUniMainModule); end. Servermodule: implementation {$R *.dfm} uses UniGUIVars, mainmodule; function UniServerModule: TUniServerModule; begin Result:=TUniServerModule(UniGUIServerInstance); end; procedure TUniServerModule.FirstInit; begin InitServerModule(Self); end; initialization RegisterServerModuleClass(TUniServerModule); end. Quote
Administrators Farshad Mohajeri Posted July 30, 2013 Administrators Posted July 30, 2013 Using uniDBGrid may generate extra scroll events especially when you refresh the query inside the scroll event. If you think it is a bug blease open a Bug Report and send a test case. Quote
erich.wanker Posted July 31, 2013 Author Posted July 31, 2013 Hello Farshad Mohajeri, thank you for your replay. First of all: Thank you for your great work ! As a Delphi-programmer, i am realy grateful in your efforts with uniGUI ! @AfterScroll: in my Test-Application, i display different input-frames depending on the recordtype. for this, i use "insertFrame" on "AfterScroll" ... First i thought, i made a mistake by creating the frames - but it was the 4-times creating in short time, which was called in the "AfterScroll" Event... For me, it would be nice - when the "AfterScroll" -Event would be send just 1 timer. Thank You Erich Quote
Administrators Farshad Mohajeri Posted July 31, 2013 Administrators Posted July 31, 2013 Hello Farshad Mohajeri, thank you for your replay. First of all: Thank you for your great work ! As a Delphi-programmer, i am realy grateful in your efforts with uniGUI ! @AfterScroll: in my Test-Application, i display different input-frames depending on the recordtype. for this, i use "insertFrame" on "AfterScroll" ... First i thought, i made a mistake by creating the frames - but it was the 4-times creating in short time, which was called in the "AfterScroll" Event... For me, it would be nice - when the "AfterScroll" -Event would be send just 1 timer. Thank You Erich I need a testcase. Please add a report to Bug Reports forums. Thanks Quote
rasaliad Posted August 1, 2013 Posted August 1, 2013 Hi Erich Why you can't use a mastersrouce relation between datasets, and when you move in person table it will show in the vertrag grid the corresponding records and so on in objtek.? Liriano Quote
erich.wanker Posted August 1, 2013 Author Posted August 1, 2013 Hello Liriano, if i use "afterScroll" - the performance is higher ( ca 25 %) and i can use more complex SQL-Statements with station_id, user_id .. and some other informations .. a fix relation is not given in some situations as a small example: show all contracts from person_1 and allso all contracts where the actual user has 25% participation .. i think - the "afterScroll"-Event is the right place for such SQL-Statements Nice Greerings from the hot (29 Degree celsius) Salzburgerland :-) 1 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.