You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Angelo Chen <an...@yahoo.com.hk> on 2009/03/17 13:51:41 UTC

t5: referring to prototype.js in html

Hi,

I need to refer to prototype.js in a html, here is what I did:
  <script type="text/javascript"
src="${asset:context:/scriptaculous/prototype.js}" />
but got exception like this:
Could not convert 'asset:context:/scriptaculous/prototype.js' into a
component parameter binding: Unable to locate asset
'context:scriptaculous/prototype.js' (the file does not exist).

any idea? thanks
-- 
View this message in context: http://www.nabble.com/t5%3A-referring-to-prototype.js-in-html-tp22558456p22558456.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


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


Re: t5: referring to prototype.js in html

Posted by Howard Lewis Ship <hl...@gmail.com>.
That will work, it's the preferred way. Lurking in that detail is an
abstraction about:  1) whether it is on the classpath: or in the
context:  and 2) what version it is.  You can use a different version
of Prototype/Scriptaculous if you wish and redirect Tapestry, by
overriding the tapestry.scriptaculous symbol, to use your version not
its internal version.

On Tue, Mar 17, 2009 at 12:27 PM, Felix Gonschorek <fe...@gg-media.biz> wrote:
> today i wanted to solve a similar problem: include the prototype.js in a
> page that has no prototype included by tapestry, because i did not use any
> js-related components.
>
> i included the prototype js library with a page annotation:
>
> @IncludeJavaScriptLibrary("${tapestry.scriptaculous}/prototype.js")
>
> if found the ${tapestry.scriptaculous} variable in the tapestry sources.
>
>
> Angelo Chen schrieb:
>>
>> Hi,
>>
>> I need to refer to prototype.js in a html, here is what I did:
>>  <script type="text/javascript"
>> src="${asset:context:/scriptaculous/prototype.js}" />
>> but got exception like this:
>> Could not convert 'asset:context:/scriptaculous/prototype.js' into a
>> component parameter binding: Unable to locate asset
>> 'context:scriptaculous/prototype.js' (the file does not exist).
>>
>> any idea? thanks
>
> --
> Felix Gonschorek
> GG-Media
>
> Kirchstr. 18
> 69115 Heidelberg
>
> Tel: +49 6221 890 168-0
> Fax: +49 6221 890 168-1
> Mobil: +49 176 2234 1338
>
> felix@gg-media.biz
> http://www.gg-media.biz
>
> Vertretungsberechtigte Gesellschafter:
> Felix Gonschorek & Jochen Greiner
>
> Umsatzsteuer-Identifikationsnummer
> gemäß § 27a Umsatzsteuergesetz:
> DE232906440
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>



-- 
Howard M. Lewis Ship

Creator Apache Tapestry and Apache HiveMind

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


Re: t5: referring to prototype.js in html

Posted by Felix Gonschorek <fe...@gg-media.biz>.
today i wanted to solve a similar problem: include the prototype.js in a page 
that has no prototype included by tapestry, because i did not use any js-related 
components.

i included the prototype js library with a page annotation:

@IncludeJavaScriptLibrary("${tapestry.scriptaculous}/prototype.js")

if found the ${tapestry.scriptaculous} variable in the tapestry sources.


Angelo Chen schrieb:
> Hi,
> 
> I need to refer to prototype.js in a html, here is what I did:
>   <script type="text/javascript"
> src="${asset:context:/scriptaculous/prototype.js}" />
> but got exception like this:
> Could not convert 'asset:context:/scriptaculous/prototype.js' into a
> component parameter binding: Unable to locate asset
> 'context:scriptaculous/prototype.js' (the file does not exist).
> 
> any idea? thanks

-- 
Felix Gonschorek
GG-Media

Kirchstr. 18
69115 Heidelberg

Tel: +49 6221 890 168-0
Fax: +49 6221 890 168-1
Mobil: +49 176 2234 1338

felix@gg-media.biz
http://www.gg-media.biz

Vertretungsberechtigte Gesellschafter:
Felix Gonschorek & Jochen Greiner

Umsatzsteuer-Identifikationsnummer
gemäß § 27a Umsatzsteuergesetz:
DE232906440

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


Re: referring to prototype.js in html

Posted by Onno Scheffers <on...@piraya.nl>.
>
> Why would you need to refer to prototype.js?



It can be very useful if you want your template to be fully working and
previewable. I copied the Prototype library into my js-folder so I can
easily include it in the templates. This makes it much easier for the
web-designers to work on the pages. Especially if they do Javascript as
well.

Since I'm using borders for my pages, anything that's included in the
head-section of the page by the designers is ignored when Tapestry renders
the page. That way it works for both the developers and the designers.

regards,

Onno

Re: referring to prototype.js in html

Posted by Howard Lewis Ship <hl...@gmail.com>.
Why would you need to refer to prototype.js?  If you simply inlcude
any JavaScript on the page, via RenderSupport, it is added to the
rendered page automatically.

On Tue, Mar 17, 2009 at 6:37 AM, ningdh <ni...@gmail.com> wrote:
> Hi,
>
> I think it should be ${asset:context:scriptaculous/prototype.js}" without the leading /.

This is not going to work.


>
> DH
>
> ----- Original Message -----
> From: "Angelo Chen"
> To: <us...@tapestry.apache.org>
> Sent: Tuesday, March 17, 2009 8:51 PM
> Subject: t5: referring to prototype.js in html
>
>
>>
>> Hi,
>>
>> I need to refer to prototype.js in a html, here is what I did:
>>  <script type="text/javascript"
>> src="${asset:context:/scriptaculous/prototype.js}" />
>> but got exception like this:
>> Could not convert 'asset:context:/scriptaculous/prototype.js' into a
>> component parameter binding: Unable to locate asset
>> 'context:scriptaculous/prototype.js' (the file does not exist).
>>
>> any idea? thanks
>> --
>> View this message in context: http://www.nabble.com/t5%3A-referring-to-prototype.js-in-html-tp22558456p22558456.html
>> Sent from the Tapestry - User mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>>



-- 
Howard M. Lewis Ship

Creator Apache Tapestry and Apache HiveMind

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


Re: referring to prototype.js in html

Posted by ningdh <ni...@gmail.com>.
Hi,

I think it should be ${asset:context:scriptaculous/prototype.js}" without the leading /.

DH

----- Original Message ----- 
From: "Angelo Chen" 
To: <us...@tapestry.apache.org>
Sent: Tuesday, March 17, 2009 8:51 PM
Subject: t5: referring to prototype.js in html


> 
> Hi,
> 
> I need to refer to prototype.js in a html, here is what I did:
>  <script type="text/javascript"
> src="${asset:context:/scriptaculous/prototype.js}" />
> but got exception like this:
> Could not convert 'asset:context:/scriptaculous/prototype.js' into a
> component parameter binding: Unable to locate asset
> 'context:scriptaculous/prototype.js' (the file does not exist).
> 
> any idea? thanks
> -- 
> View this message in context: http://www.nabble.com/t5%3A-referring-to-prototype.js-in-html-tp22558456p22558456.html
> Sent from the Tapestry - User mailing list archive at Nabble.com.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
> 
>