You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Matias Moran <ma...@yahoo.com.ar> on 2010/11/08 15:59:36 UTC

Question about mixins

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.



      

Re: Question about mixins

Posted by LLTYK <LL...@mailinator.com>.
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: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Question about mixins

Posted by Mats Andersson <ma...@ronsoft.se>.
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: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Question about mixins

Posted by Matias Moran <ma...@yahoo.com.ar>.
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.





      

Re: Question about mixins

Posted by LLTYK <LL...@mailinator.com>.
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: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Question about mixins

Posted by ael <al...@dash.com.ph>.
Use Zone & Blocks
-- 
View this message in context: http://tapestry.1045711.n5.nabble.com/Question-about-mixins-tp3255155p3259969.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org