If you need to load all scripts when page is loaded just place @Import annotation to your page java class. There is no way to make it dynamicly as components placed in block are not rendered and as result doesn't add their scripts to page. You need to specify all scripts explicitly.
Or you can try to create your own hack that will render your block and then remove it: public class DirtyHack { @Parameter(required = true, defaultPrefix = BindingConstants.BLOCK) private Block block; @Mixin private DiscardBody discardBody; private Element element; @BeginRender Object begin(final MarkupWriter writer) { element = writer.element("placeholder"); return block; } @AfterRender void end(final MarkupWriter writer) { writer.end(); element.remove(); } } <t:dirtyhack block="myBlock"/> <t:block id="myBlock"> ... </t:block/> But I not recommend this hack as it will render all hidden components markup for every page request. Just specify all scrips in page @Import explicitly. On Fri, Sep 21, 2012 at 11:18 AM, rosecorp <rosecorp.soluti...@gmail.com>wrote: > Hi Thiago, > > Maybe I wasn't clear in my first post. I will paraphrase my problem. > > I am using tapestry5-jquery and there is a use case where I load page with > 3 > different options to choose which are event links and then I handle it in > java code to render particular block. The problem is that one of those > blocks contain several of complicated component like file upload, > accordions > etc. and I see in Firebug that all js are being loaded after ajax call > which > is not very nice for user experience. At the moment I have sorted this > problem basically to load those components once page has been loaded in a > hidden div and then after ajax call I will show up those hidden divs but I > think this solutions is nasty. Is there any better way to do this? > > Thanks in advance and sorry for a long explanation. > > > > -- > View this message in context: > http://tapestry.1045711.n5.nabble.com/Preload-js-after-block-update-tp5716410p5716425.html > Sent from the Tapestry - User mailing list archive at Nabble.com. > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org > For additional commands, e-mail: users-h...@tapestry.apache.org > > -- BR Ivan