uniguibbs Posted August 2, 2013 Posted August 2, 2013 unitimer do not work in UniMainModule and UniServerModule? i put a unitimer in UniMainModule , but it doesn't work. why? Quote
mhmda Posted August 2, 2013 Posted August 2, 2013 Unitimer is client side and unimodule is server side.... in web development the concept is different from regular programming: in web there is the server side who produce the webpage and do the database work... and the client side which is the page you see in the browser...So the timer is js code which run in the client side (in the browser not in the server). If you wish to run server side code from the timer then use ajax: Put this code in the timer: ajaxRequest(MainForm.window, 'myfunc', [] );//in the [] you may pass params and in the form events "OnAjaxEvent" put this code: procedure TMainForm.UniFormAjaxEvent(Sender: TComponent; EventName: string; Params: TStrings); begin If SameText(EventName, 'myfunc' ) Then Begin myfunc;//your procedure or function End; end; and your func declared in the form or in the mainmodule: procedure TUniMainModule.myfunc; begin showmessage('hello from server side using ajax'); end; I hope it will help you Quote
uniguibbs Posted August 2, 2013 Author Posted August 2, 2013 thanks for your hint, mohammad . i will try 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.