Question about mixins

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Question about mixins

Matias Moran
Dear Tapestry users,

    I'm using a mixins into a Zone, that updates the grid every a given time period:
<t:zone t:id="zone" id="zone" t:update="show" t:mixins="condorTapestryLib/PeriodicUpdate" period="10" event="update">

    The problem is that when I change the page, and redirect another page that contains a different Grid, after a few seconds it paste the previous page's Grid to the new page. I would like to know if there is a way to stop the javascript from the Tapestry page. The PeriodicUpdate javascript contains a stop method, but I don't know how to invoke this.

   Thanks in advance!

         Matias.



Reply | Threaded
Open this post in threaded view
|

Re: Question about mixins

lltyk

It sounds like something else is at work here, javascript timers should all
get reset when the page changes.

So either the page is not really changing or that mixin is somehow being
called again on the second page.
--
View this message in context: http://tapestry-users.832.n2.nabble.com/Question-about-mixins-tp5717182p5717676.html
Sent from the Tapestry Users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Question about mixins

Matias Moran
As you say, LLTYK, we don't change pages, instead we switch zones.
Is there any way we could do it using zones, instead of changing everything to pages?

Thanks for the response!
Greetings.

Matias.





Reply | Threaded
Open this post in threaded view
|

Re: Question about mixins

Mats Andersson-2
I assume that you are maintaining the condorTapestryLib/PeriodicUpdate
mixin. You could add a html element to the body of the zone as long as
you want the zone to be updated. Pass the id of that element as a
parameter to the mixin and let the mixin check if the element exists
before calling the zone update part. If it does not exist, you know that
the javascript timer should be cancelled.



Best Regards
Mats


Matias Moran skrev 2010-11-09 13:24:

> As you say, LLTYK, we don't change pages, instead we switch zones.
> Is there any way we could do it using zones, instead of changing everything to pages?
>
> Thanks for the response!
> Greetings.
>
> Matias.
>
>
>
>
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

ael
Reply | Threaded
Open this post in threaded view
|

Re: Question about mixins

ael
In reply to this post by Matias Moran
Use Zone & Blocks
Reply | Threaded
Open this post in threaded view
|

Re: Question about mixins

lltyk
In reply to this post by Matias Moran

Another approach I've taken was setting the actual javascript mixin object as
a property of the element it's related to ('$(zoneid).periodicupdate=this').
So in the constructor of the mixin, you'd check whether that property
existed already, call stop on the old one if present, then replace the old
one with the new one.
--
View this message in context: http://tapestry-users.832.n2.nabble.com/Question-about-mixins-tp5717182p5732514.html
Sent from the Tapestry Users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]