tapestry-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paul Stanton <p...@mapshed.com.au>
Subject waitForPage / onDOMLoaded hybrid
Date Sun, 06 Mar 2011 22:44:09 GMT
Hi all,

i'm using tapestry 5.1.0.5 on this particular project.

I'm not 100% sure this isn't already available, but before duplicating 
logic i thought I'd check...

I need to be able to call a function at any point in the page state (ie 
before it's loaded, during loading, after load) but have it wait until 
tapestry.init has been called.

Kind of how Tapestry.waitForPage works, except that if the page has not 
loaded, instead of showing a dialog, it would register it for invoking 
once the page is loaded.

so in psuedo:

function(callback)
{
     if(Tapestry.pageLoaded)
         invoke(callback);
     else
         Tapestry.onDOMLoaded(callback);
}

2 questions:
a) is this functionality already available? where?
b) would the above approach be fool-proof? ie would there be a case 
where Tapestry.pageLoaded == false and Tapestry.onDOMLoaded would still 
not invoke the callback?

thanks, p.


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


Mime
View raw message