You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Denis Ponomarev <oz...@romsat.ua> on 2003/05/05 13:01:50 UTC

JavaScript from private asset not included into page

Hello tapestry users!

I've designed my component, which uses external static JavaScript.
I want to put this script into the component's library jar. So I need
to specify private asset in my *.jwc:

<private-asset name="script" resource-path="MyScript.js"/>

I've expected something like

<script language="JavaScript" type="text/javascript" src="/mysite/app?service=asset&HereIsFullPathToMyScrip.js"></script>

on the rendered page, but there is no such.
Page contains Body and Shell components.
Did I forgot something else?

Please help.

Thank you.

-- 
Denis


Re[3]: JavaScript from private asset not included into page

Posted by Denis Ponomarev <oz...@romsat.ua>.
Solution found in DatePicker's renderComponent method:

//=======================

Body body = Body.get(cycle);
IAsset script = getAsset("script");
body.includeScript(script.buildURL(cycle));

//=======================

easy :)


Re[2]: JavaScript from private asset not included into page

Posted by Denis Ponomarev <oz...@romsat.ua>.
HMLS> I <private-asset> just declares an asset, it doesn't include it in the page.
HMLS> The Script component can help here.

Thanks for answer, but I'm talking about *.js, not the *.script file.

I want to use ordinal JavaScript file, like standard DatePicker component did.
In it's *.jwc I found only

    <private-asset name="script" resource-path="DatePicker.js"/>

and in workbench application this works.
How can I do the same?


RE: JavaScript from private asset not included into page

Posted by "Howard M. Lewis Ship" <hl...@attbi.com>.
I <private-asset> just declares an asset, it doesn't include it in the page.
The Script component can help here.

--
Howard M. Lewis Ship
Creator, Tapestry: Java Web Components
http://jakarta.apache.org/tapestry



> -----Original Message-----
> From: Denis Ponomarev [mailto:oz@romsat.ua] 
> Sent: Monday, May 05, 2003 7:02 AM
> To: tapestry-user@jakarta.apache.org
> Subject: JavaScript from private asset not included into page
> 
> 
> Hello tapestry users!
> 
> I've designed my component, which uses external static 
> JavaScript. I want to put this script into the component's 
> library jar. So I need to specify private asset in my *.jwc:
> 
> <private-asset name="script" resource-path="MyScript.js"/>
> 
> I've expected something like
> 
> <script language="JavaScript" type="text/javascript" 
> src="/mysite/app?service=asset&HereIsFullPathToMyScrip.js"></script>
> 
> on the rendered page, but there is no such.
> Page contains Body and Shell components.
> Did I forgot something else?
> 
> Please help.
> 
> Thank you.
> 
> -- 
> Denis
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>