You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Jim Roycroft <ji...@codesilver.ca> on 2007/10/16 08:29:59 UTC
T4.1: Scriptaculous - automatically adding required js files
Using 4.1.3, I would like to make use of the "Effect" features provided by
Scriptaculous... for example:
<div onclick="new Effect.SwitchOff(this)">
Click here to make this text disappear
</div>
If I put that code in a regular Tapestry page, nothing happens (because the
required javascript files are not included), however if I add the "Suggest"
component to the page, it works just fine.
How does the suggest component get Tapestry to automatically include the
appropriate prototype+scriptaculous scripts that it requires? How can I
specify the scripts I need for a custom component?
Or in other words (I think)... how do I do this with Scriptaculous? :
dojo.require("some.dojo.feature")
Thanks,
Jim
--
View this message in context: http://www.nabble.com/T4.1%3A-Scriptaculous---automatically-adding-required-js-files-tf4632239.html#a13227495
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: T4.1: Scriptaculous - automatically adding required js files
Posted by Jim Roycroft <ji...@codesilver.ca>.
Thank you!
I was originally trying to do this with:
But I was getting an org.xml.sax.SAXParseException saying: "Content is not
allowed in prolog."
Adding this stuff to the script file and calling that did the trick!
Jim
andyhot wrote:
>
> Suggest includes Suggest.script which contains
>
> <script>
> <include-script resource-path="/scriptaculous-1.7.1/prototype.js" />
> <include-script resource-path="/scriptaculous-1.7.1/effects.js" />
> <include-script resource-path="/scriptaculous-1.7.1/controls.js" />
> ...
> </script>
>
> So, you could create you own Scriptaculous.script with the above contents
> and include it in any page that you want using:
>
>
>
> Jim Roycroft wrote:
>> Using 4.1.3, I would like to make use of the "Effect" features provided
>> by
>> Scriptaculous... for example:
>>
>> <div onclick="new Effect.SwitchOff(this)">
>> Click here to make this text disappear
>> </div>
>>
>> If I put that code in a regular Tapestry page, nothing happens (because
>> the
>> required javascript files are not included), however if I add the
>> "Suggest"
>> component to the page, it works just fine.
>>
>> How does the suggest component get Tapestry to automatically include the
>> appropriate prototype+scriptaculous scripts that it requires? How can I
>> specify the scripts I need for a custom component?
>>
>> Or in other words (I think)... how do I do this with Scriptaculous? :
>> dojo.require("some.dojo.feature")
>>
>> Thanks,
>> Jim
>>
>
> --
> Andreas Andreou - andyhot@apache.org - http://andyhot.di.uoa.gr
> Tapestry / Tacos developer
> Open Source / JEE Consulting
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>
>
--
View this message in context: http://www.nabble.com/T4.1%3A-Scriptaculous---automatically-adding-required-js-files-tf4632239.html#a13228329
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: T4.1: Scriptaculous - automatically adding required js files
Posted by andyhot <an...@di.uoa.gr>.
Suggest includes Suggest.script which contains
<script>
<include-script resource-path="/scriptaculous-1.7.1/prototype.js" />
<include-script resource-path="/scriptaculous-1.7.1/effects.js" />
<include-script resource-path="/scriptaculous-1.7.1/controls.js" />
...
</script>
So, you could create you own Scriptaculous.script with the above contents
and include it in any page that you want using:
<span jwcid="@Script" script="Scriptaculous.script"/>
Jim Roycroft wrote:
> Using 4.1.3, I would like to make use of the "Effect" features provided by
> Scriptaculous... for example:
>
> <div onclick="new Effect.SwitchOff(this)">
> Click here to make this text disappear
> </div>
>
> If I put that code in a regular Tapestry page, nothing happens (because the
> required javascript files are not included), however if I add the "Suggest"
> component to the page, it works just fine.
>
> How does the suggest component get Tapestry to automatically include the
> appropriate prototype+scriptaculous scripts that it requires? How can I
> specify the scripts I need for a custom component?
>
> Or in other words (I think)... how do I do this with Scriptaculous? :
> dojo.require("some.dojo.feature")
>
> Thanks,
> Jim
>
--
Andreas Andreou - andyhot@apache.org - http://andyhot.di.uoa.gr
Tapestry / Tacos developer
Open Source / JEE Consulting
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org