Yes, that works, but now I've run into yet another issue. I need to add this library to the top of the js stack. I assumed I could do this with decorateClientInfrastructure, but ClientInfrastructure is deprecated and it is not clear how and where I can access and modify the js stack now.
On Wed, May 4, 2011 at 9:25 AM, Taha Hafeez <tawus.tapes...@gmail.com>wrote: > Won't this work > > public class Layout { > > @Inject > private JavaScriptSupport javaScriptSupport; > > void afterRender(){ > if(condition){ > javaScriptSupport.importJavaScriptLibrary("..."); > } > } > > regards > Taha > > > On Wed, May 4, 2011 at 7:51 PM, Ray Nicholus <rnicho...@widen.com> wrote: > > > Sigh, that didn't work. Surely it can't be this difficult to add a js > > library to all pages in Tapestry. I must be doing something wrong. Note > > that I cannot use the import in my layouts as I can only add this library > > conditionally. > > > > On Wed, May 4, 2011 at 9:09 AM, Ray Nicholus <rnicho...@widen.com> > wrote: > > > > > n/m, I found an example at > > > > > > http://tapestry.1045711.n5.nabble.com/Global-stylesheets-and-Javascripts-documentation-proposal-td2433280.html > > > > > > > > > On Wed, May 4, 2011 at 9:05 AM, Ray Nicholus <rnicho...@widen.com> > > wrote: > > > > > >> I looked at the documentation for contributeMarkupRenderer, and I'm > not > > >> even sure what this is, much less what I need to do to simply add a js > > >> library to each page. Are there any useful examples that explain how > to > > add > > >> a js library to a page in this manner? > > >> > > >> > > >> On Wed, May 4, 2011 at 8:44 AM, Taha Hafeez <tawus.tapes...@gmail.com > > >wrote: > > >> > > >>> You can add it to your layout as > > >>> > > >>> @Import(library = "yourlibraryname.js") > > >>> public class Layout { > > >>> } > > >>> > > >>> or > > >>> > > >>> You can also add it by contributing to MarkupRendererFilter > > >>> > > >>> regards > > >>> Taha > > >>> > > >>> > > >>> On Wed, May 4, 2011 at 7:08 PM, Ray Nicholus <rnicho...@widen.com> > > >>> wrote: > > >>> > > >>> > Any idea how I can easily do this? Ideally, I'd like to only make > > this > > >>> > happen if a specific JVM arg is present. > > >>> > > > >>> > > >> > > >> > > > > > >