CGDevTools Forum

Welcome to the Official CGDevTools Support Community Forums.

Timer and Async events

by Jorge Sousa » 02 Sep 2014 20:53

Hey George

It's time to you submit that Intraweb bug in EMBT Forums, since they are now stable
Best Regards
CGDevTools Develop / Support Team
Home Page: http://www.cgdevtools.com
Jorge Sousa
 
Posts: 4261
Joined: 17 May 2012 09:58

by Jorge Sousa » 02 Sep 2014 20:53

Hey George

It's time to you submit that Intraweb bug in EMBT Forums, since they are now stable
Best Regards
CGDevTools Develop / Support Team
Home Page: http://www.cgdevtools.com
Jorge Sousa
 
Posts: 4261
Joined: 17 May 2012 09:58

by George » 02 Sep 2014 21:01

Hello :)

Its already there, and Alexandre said that it's not a bug.
(as i think, it's architectural issue, since IW is pretty old and probably not so optimized (in some parts) for ajax usage).

I posted here conclusion and approach to use timers with frames when full submit is not an option.
Best regards!
George
 
Posts: 486
Joined: 23 May 2013 15:50
Location: Russia, Moscow

by Jorge Sousa » 02 Sep 2014 21:07

Hi

If it's not a bug why it works on an IWForm and not in a Frame?
Best Regards
CGDevTools Develop / Support Team
Home Page: http://www.cgdevtools.com
Jorge Sousa
 
Posts: 4261
Joined: 17 May 2012 09:58

by George » 03 Sep 2014 07:09

cgdevtools_support wrote:Hi
If it's not a bug why it works on an IWForm and not in a Frame?

Because form (with all controls that placed inside) rendered without async events, so when webapp starts (opened main app form), timers already initialized.
When i create frame at runtime (with timer component inside), and use render region async to get frame visual components, timer is still not rendered (if i understand Alexandre correctly). Only full submit can render timers at runtime.
That can explain why onasynctimer event not works. But why not works server side ontimer event from frame - i don't know.
Best regards!
George
 
Posts: 486
Joined: 23 May 2013 15:50
Location: Russia, Moscow

by mjq » 03 Oct 2014 03:56

Hello George!

All timer objects should be placed inside main form (i use only one form).
Each frame can contain event handler for timer as usual, all what required is to assign handler to corresponding timer when frame is created and start timer, then stop timer when frame is destroy.


I reached same conclusion before I found this thread. ;)

BTW, is there a way to stop IWTimer using async events?

Since I couldn't find proper way, I tried to use sync event (Ajax:=False).
But this solution contains some troubles
(e.g. showing dialogs by using same sync event)...
mjq
 
Posts: 58
Joined: 20 Aug 2014 02:46

by George » 03 Oct 2014 08:10

BTW, is there a way to stop IWTimer using async events?

I never tried this, and this not works. OMG! What a stupid situation.
Honestly, i want use server side timers. I not understand why timer should be placed inside html and work via javascript and call server side async timer handler when i have server side code that should be executed periodically. Really not understand.
And now you told that i even can't stop timer via button with async click.

BUT, if i add variable "StopThisDamnTimer:boolean" and inside button write:
delphi code
StopThisDamnTimer := True

And timer code will contain this:
delphi code
if StopThisDamnTimer then
begin
timer.Enabled := false;
exit;
end

Timer will stop.

CG, can you make a little present for us? :) - normal timer realization..
That will work on server side without any JS.
Best regards!
George
 
Posts: 486
Joined: 23 May 2013 15:50
Location: Russia, Moscow

by mjq » 15 Oct 2014 06:04

I think that it should be realized.
The timer which can be stopped by async events.

It's I guess difficult to realize, but...
mjq
 
Posts: 58
Joined: 20 Aug 2014 02:46

by Jorge Sousa » 15 Oct 2014 09:52

Hi

When you say Timer, do you mean the TTimer ?
Best Regards
CGDevTools Develop / Support Team
Home Page: http://www.cgdevtools.com
Jorge Sousa
 
Posts: 4261
Joined: 17 May 2012 09:58

by mjq » 15 Oct 2014 11:00

Sorry. The answer is NO.

I just thought I wish there is perfect 'IWTimer' which can be stopped by async events.

It's a mere wish. ;)
But many pending problems would be solved if there is it.
mjq
 
Posts: 58
Joined: 20 Aug 2014 02:46

PreviousNext

Return to General

cron

Who is online

Users browsing this forum: No registered users and 23 guests

Contact Us.