Initialy, the onclick handler would be supplied as: <a href="mpage.mycomponent" onclick="javascript:Tapestry.waitForPageLoad();">update zone</a>
Thus, if you click it while the page is still loading, the waitForPageLoad() function will be invoked, which can raise the warning dialog. Once the page is fully loaded, the waitForPageLoad() handler is removed or deactivated, and additional onclick event handlers can be added via Prototype's Event.observe() function. The diffrerence between this and Tapestry 5.1.0.0 is that there's no inline onclick event handler; clicking the link while the scripts are loading results in a non-Ajax component event request (as opposed to an Ajax component event request via XmlHttpRequest). On Fri, Feb 27, 2009 at 4:41 PM, Martin Strand <do.not.eat.yellow.s...@gmail.com> wrote: > On Sat, 28 Feb 2009 01:11:15 +0100, Howard Lewis Ship <hls...@gmail.com> > wrote: > >> The >> end result it that you can "outrace" Tapestry, click a link that >> should update a zone and get incorrect behavior or even a runtime >> exception. I actually see this when using Formo's time-tracking >> application from home through a slow pipe, exacerbated by HTTPS, where >> I get the error that "Block is not a valid response type". What should >> have been an Ajax request was processed instead as a traditional page >> render request, because the JavaScript was not ready. >> >> An earlier version of Tapestry 5 approached this problem by disabling >> the link components when the zone parameter was in use; that is, the >> href parameter was written out a "#", so the only way the link would >> be active is via an attached onclick event handler. >> >> This solution was weak, because there was no graceful degradation: >> clients without JavaScript would have a non-functioning application. >> Thus it was changed to render the href normally AND add an onclick >> event handler, which leads to the race conditions described above. > > I didn't quite understand this part. If a user clicks the link before its > onclick handler has been added, wouldn't that result in the same behaviour as > having javascript disabled? > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org > For additional commands, e-mail: users-h...@tapestry.apache.org > > -- Howard M. Lewis Ship Creator Apache Tapestry and Apache HiveMind --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org