Hello Hadass,
Wt does not know what you do in a WTimer, so it cannot decide when it
is appropriate to fire it or not. As long as the WTimer object exists,
it will fire, unless you stop the timer. From your description, It
seems that you want to start the timer when the page is visible, and
stop it when it becomes hidden. One method to do this is to override
the default setHidden method to do this (assuming hide() and show() is
used to hide/show the pages):
void ScheduledContatiner::setHidden(bool hide)
{
if (hide) {
timer_.stop();
} else {
timer_.start();
}
WContainer::setHidden(hide);
}
Alternatively, call start/stop your timers from the functions where
you change the visible pages.
Regards,
Wim.
2009/11/25 HADASS YAARI <[email protected]>:
> Hi everybody,
> My web site has 5 dynamic pages. I've created a class ScheduledContatiner
> that is built just like the impossible example with the timer.
> All of my pages inherit from ScheduledContatiner.
> I've noticed that even though one page is not watched (I've activated
> another page) - its timer is still working.
> The reason I've noticed it, was because (as I mentioned in another mail)
> there is one very heavy page that it's loading time is very long. So I've
> noticed that even when I watch a very simple page (with 4 table cells), the
> loading time is very long. When I stop the timer of the heavy page, the
> other pages are being loaded fast and without the user notice.
> Is it suppose to be like this? I thought that if page is not activated (on
> the screen), it's methods are not being called.
> Is there a way to prevent it?
> Thank you very much and godd day
> Hadas
> ________________________________
> This message (including any attachments) issued by RAFAEL- ADVANCED DEFENSE
> SYSTEMS LTD. (hereinafter "RAFAEL") contains confidential information
> intended for a specific individual and purpose, may constitute information
> that is privileged or confidential or otherwise protected from disclosure.
> If you are not the intended recipient, you should contact us immediately and
> thereafter delete this message from your system. You are hereby notified
> that any disclosure, copying, dissemination, distribution or forwarding of
> this message, or the taking of any action based on it, is strictly
> prohibited. If you have received this e-mail in error, please notify us
> immediately by e-mail mailto:[email protected] and completely delete or
> destroy any and all electronic or other copies of the original message and
> any attachments thereof.
> ________________________________
> ------------------------------------------------------------------------------
> Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
> trial. Simplify your report design, integration and deployment - and focus
> on
> what you do best, core application coding. Discover what's new with
> Crystal Reports now. http://p.sf.net/sfu/bobj-july
> _______________________________________________
> witty-interest mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/witty-interest
>
>
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
witty-interest mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/witty-interest