You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Jonathan O'Connor <ni...@eircom.net> on 2009/11/02 16:02:31 UTC

Component only invokes javascript correctly from BeginRender

Hi,
I have a strange problem. One of my colleagues found a javascript 
library ajaxtabs from DynamicDrive.com, and he created a small component 
wrapping its usage. His code makes use of @BeginRender to generate the 
html. The last part of this generated html is a little script that 
invokes the ajax tabs javascript.

I wanted to change the BeginRender code into MyTabs.tml instead.
Naturally, everything looks fine, and the generated html looks the same 
as that explicitly written by the BeginRender method, but the java 
script does not work properly. I suspect that it is throwing an 
exception while running.

I also tried setting the javascript to run on DOMLoaded(), but that does 
not work at all, from BeginRender, or .tml.

Is there any reason why it should work correctly with BeginRender 
method, but not a .tml file?

Ciao,
Jonathan O'Connor

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


Re: Component only invokes javascript correctly from BeginRender

Posted by "Thiago H. de Paula Figueiredo" <th...@gmail.com>.
Em Mon, 02 Nov 2009 13:02:31 -0200, Jonathan O'Connor  
<ni...@eircom.net> escreveu:

> Hi,

Hi!

> I wanted to change the BeginRender code into MyTabs.tml instead.
> Naturally, everything looks fine, and the generated html looks the same  
> as that explicitly written by the BeginRender method, but the java  
> script does not work properly. I suspect that it is throwing an  
> exception while running.

@BeginRender methods are only invoked when the whole page is requested,  
not when a partial render (AJAX) is done. Anyway, putting that code in the  
component makes it more reusable.

-- 
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,  
and instructor
Owner, software architect and developer, Ars Machina Tecnologia da  
Informação Ltda.
http://www.arsmachina.com.br

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