You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Julien HENRY <he...@yahoo.fr> on 2008/03/29 16:28:28 UTC

Re : Re : [T5] How to add JavaScript in a component used in a layout

Hi Mike,

Thanks you very much for your help. I was trying to show you how to reproduce the bug when I accidentaly found the real problem. You can't put the t:type="layout" on your <body> tag. It works on the <html> tag and it works on a <div> tag. But not on the <body>. I have opened a bug: https://issues.apache.org/jira/browse/TAPESTRY-2314 because I don't think it is the same as your own (and I didn't find it BTW).

Best regards,

Julien

----- Message d'origine ----
De : Michael Lake <ml...@netvue.com>
À : Tapestry users <us...@tapestry.apache.org>
Envoyé le : Samedi, 29 Mars 2008, 18h50mn 33s
Objet : Re: Re : [T5] How to add JavaScript in a component used in a layout


Are you sure that the page you're outputting has proper <html><body></ 
body></html> tags? I've been burned by forgetting my <body /> tags  
which I believe are needed for tapestry to add scripts, but tapestry  
doesn't give you any warning that the scripts haven't been added. I  
think I made a Jira for this a couple months ago.

-mike


On Mar 29, 2008, at 6:03 AM, Julien HENRY wrote:

> In fact, it could be a bug. I tried to add a beaneditform component  
> in the Start page, and I have JavaScript (for client side  
> validation). Just put the beaneditform in the Layout.tml instead and  
> there is no more Javascript.
>
> Should I open a bug in JIRA?
>
> Regards
>
> ----- Message d'origine ----
> De : Julien HENRY <he...@yahoo.fr>
> À : users@tapestry.apache.org
> Envoyé le : Samedi, 29 Mars 2008, 15h23mn 34s
> Objet : [T5] How to add JavaScript in a component used in a layout
>
> Hi,
>
> I'm using a custom JAR-packaged component in a template. When I use  
> the component directly in a page (Start.tml) I have both JavaScript  
> and CSS file included in the HTML. But when I try to put the  
> component in my application layout (Layout.tml), there is only the  
> CSS file. No JavaScript.
> In my component, I have also the following method:
>
> @IncludeJavaScriptLibrary("${path}/component.js")
> @IncludeStylesheet("${path}/component.css")
> public class MyComponent {
>
> ....
>
> void beginRender(MarkupWriter writer) {
>
>        _pageRenderSupport.addScript("setup();");
>
>        writer.cdata("Foo Bar");
> }
>
>
> On my finale page, I have the text "Foo Bar" displayed but no  
> <script> tag at all. Only the component.css.
>
> Can you help me to solve this problem.
>
> Thanks
>
> Julien
>
>
>
>
>       
> _____________________________________________________________________________
> Envoyez avec Yahoo! Mail. Plus de moyens pour rester en contact. http://mail.yahoo.fr
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>
>
>
>
>
>       
> _____________________________________________________________________________
> Envoyez avec Yahoo! Mail. Plus de moyens pour rester en contact. http://mail.yahoo.fr
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>


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






      _____________________________________________________________________________ 
Envoyez avec Yahoo! Mail. Plus de moyens pour rester en contact. http://mail.yahoo.fr

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