Thanks for clearing that up.
Yet, I'm still thinking it might be very intuitive to create an additional
tag in the sub-page which is then merged with the template's -
it just feels right to define stylesheets & scripts in the .tml and not in
the code.
But that's just me :-)
Cheers,
Stephan
--
This is the pattern in Tapestry: there's an API that you can use, and
then we layer annotation support on top of that to do the work of
calling into the API for you. Generally, if you look at the
annotation, you'll see hyperlinks to the APIs that are ultimately
invoked.
This is true for the @Impor
I can't use annotations, since the assets are different for production
mode.
So @Import doesn't work for me!
You could either use Symbols to change the location of CSS or inject
JavaScriptSupport (or RenderSupport before Tapestry 5.2) and add the
stylesheet programmatically.
--
Chris
---
Sorry, just realized that addScriptLink() is deprecated, as is
addStylesheetLink(), in favor of:
JavaScriptSupport.importJavaScriptLibrary()
and
JavaScriptSupport.importStylesheet()
See
http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/services/javascript/JavaScriptSuppor
I guess you could call addScriptLink() from your serupRender() method. See
http://tapestry.apache.org/javascript.html
Bob Harner
On May 7, 2011 4:35 AM, "stephanos2k" wrote:
Guys, thanks for the reply.
But in my post I said
> I can't use annotations, since the assets are different for production
> mode.
>
So @Import doesn't work for me!
PS: You may ask yourself why I use different assets: I use LESS for CSS and
have multiple .less files in development and one .c
Oh, and if you need more than one something, use curly braces:
@Import(library = { "context:js/something1.js",
"context:js/something2.js"}, stylesheet = "context:css/something.css")
mrg
On Fri, May 6, 2011 at 1:29 PM, Michael Gentry wrote:
> Just use @Import in your page's class:
>
> @Import(li
On Fri, 06 May 2011 14:17:36 -0300, stephanos2k
wrote:
I have a layout L and page P. The layout has a few scripts & stylesheets
which are needed everywhere. But P requires a few specific files.
How can I add a stylesheet and a script to the final ?
See the @Import annotation. It already do
Just use @Import in your page's class:
@Import(library = "context:js/something.js", stylesheet =
"context:css/something.css")
mrg
PS. You should probably use that in your layout's class, too.
On Fri, May 6, 2011 at 1:17 PM, stephanos2k
wrote:
> I have a layout L and page P. The layout has a f
I have a layout L and page P. The layout has a few scripts & stylesheets
which are needed everywhere. But P requires a few specific files.
How can I add a stylesheet and a script to the final ?
-> I tried just defining a in P, assuming it would be merged; didn't
work.
-> I can't use annotations
10 matches
Mail list logo