uniguibbs Posted August 2, 2013 Share Posted August 2, 2013 unitimer do not work in UniMainModule and UniServerModule? i put a unitimer in UniMainModule , but it doesn't work. why? Link to comment Share on other sites More sharing options...
mhmda Posted August 2, 2013 Share 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 Link to comment Share on other sites More sharing options...
uniguibbs Posted August 2, 2013 Author Share Posted August 2, 2013 thanks for your hint, mohammad . i will try Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now