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 C." <an...@gmail.com> on 2012/08/13 02:51:13 UTC

loading order of javascripts

Hi,

I have this order of loading:

@Import(library = {"context:/js/jquery-1.7.1.js"})
public class Layout { }

@Import(library = {"context:/js/page_view.js"})
public class page_view { }

page_view extends from Layout template, in the final page html source,
page_view.js is always ahead of jquery-1.7.1.js, is there a way to re-order
this?

Thanks,

Angelo



--
View this message in context: http://tapestry.1045711.n5.nabble.com/loading-order-of-javascripts-tp5715313.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: loading order of javascripts

Posted by Emmanuel DEMEY <de...@gmail.com>.
You are right. Tapestry5-jQuery have rewritten all the JavaScript Stack in
jQuery. But you can still use the default Prototype implementation, byt
setting the JQueryConstants.SUPPRESS_PROTOTYPE to false in your appModule.
In this case all the noConflict stuff will be managed automatically.

2012/8/13 Thiago H de Paula Figueiredo <th...@gmail.com>

> On Mon, 13 Aug 2012 10:28:12 -0300, Ray Nicholus <rn...@widen.com>
> wrote:
>
>  Tapestry-jquery has rewritten all of Tapestry's js in jquery.  That's
>> quite a bit more then simply adding jquery to your app as a JavascriptStack.
>>
>
> Ah, thanks for the info. :) I've never used tapestry-jquery, which is
> unfortunate, so I completely forgot about the all-Tapestry-JavaScript-**rewritten
> part. ;)
>
>
>  My personal preference is to use Tapestry's existing (Prototype) js
>> (since it has withstood the test of time and is widely used), use jQuery in
>> no-conflict mode, and add only jquery plug-ins I need.
>>
>
> I've done the same in a personal project, long ago, for using a very nice
> jQuery color picker.
>
>
>  Using the custom event bridge I mentioned in an earlier thread,
>>
>
> Which, by the way, I saved for later in-depth reading . . .
>
>
> --
> Thiago H. de Paula Figueiredo
>
> ------------------------------**------------------------------**---------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.**apache.org<us...@tapestry.apache.org>
>
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>


-- 
Emmanuel DEMEY
Ingénieur Etude et Développement
ATOS Worldline
+33 (0)6 47 47 42 02
demey.emmanuel@gmail.com
http://emmanueldemey.fr/

Twitter : @EmmanuelDemey

Re: loading order of javascripts

Posted by Thiago H de Paula Figueiredo <th...@gmail.com>.
On Mon, 13 Aug 2012 10:28:12 -0300, Ray Nicholus <rn...@widen.com>  
wrote:

> Tapestry-jquery has rewritten all of Tapestry's js in jquery.  That's  
> quite a bit more then simply adding jquery to your app as a  
> JavascriptStack.

Ah, thanks for the info. :) I've never used tapestry-jquery, which is  
unfortunate, so I completely forgot about the  
all-Tapestry-JavaScript-rewritten part. ;)

> My personal preference is to use Tapestry's existing (Prototype) js  
> (since it has withstood the test of time and is widely used), use jQuery  
> in
> no-conflict mode, and add only jquery plug-ins I need.

I've done the same in a personal project, long ago, for using a very nice  
jQuery color picker.

> Using the custom event bridge I mentioned in an earlier thread,

Which, by the way, I saved for later in-depth reading . . .

-- 
Thiago H. de Paula Figueiredo

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


Re: loading order of javascripts

Posted by Ray Nicholus <rn...@widen.com>.
Tapestry-jquery has rewritten all of Tapestry's js in jquery.  That's quite
a bit more then simply adding jquery to your app as a JavascriptStack.

My personal preference is to use Tapestry's existing (Prototype) js (since
it has withstood the test of time and is widely used), use jQuery in
no-conflict mode, and add only jquery plug-ins I need.  Furthermore,
Twitter-Bootstrap has some pretty nice jQuery plug-ins, and it really isn't
very difficult to wrap these plugins as Tapestry common components for my
app(s).

Using the custom event bridge I mentioned in an earlier thread, I can also
trigger Prototype custom events from jQuery, and listen for Prototype
custom events from jQuery code.  This means I can trigger or listen to any
Tapestry client-side events using jQuery.

On Mon, Aug 13, 2012 at 7:26 AM, Thiago H de Paula Figueiredo <
thiagohp@gmail.com> wrote:

> On Sun, 12 Aug 2012 22:12:52 -0300, Ray Nicholus <rn...@widen.com>
> wrote:
>
>  Jquery should really be part of a JavascriptStack.  in fact, it should
>> probably be its own stack.  You can add any jquery plugins and
>> stylesheets to this stack as well.
>>
>
> Hasn't tapestry-jquery done this already?
>
> --
> Thiago H. de Paula Figueiredo
>
>
> ------------------------------**------------------------------**---------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.**apache.org<us...@tapestry.apache.org>
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>

Re: loading order of javascripts

Posted by Thiago H de Paula Figueiredo <th...@gmail.com>.
On Sun, 12 Aug 2012 22:12:52 -0300, Ray Nicholus <rn...@widen.com>  
wrote:

> Jquery should really be part of a JavascriptStack.  in fact, it should
> probably be its own stack.  You can add any jquery plugins and  
> stylesheets to this stack as well.

Hasn't tapestry-jquery done this already?

-- 
Thiago H. de Paula Figueiredo

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


Re: loading order of javascripts

Posted by Chris Mylonas <ch...@opencsta.org>.
I had a similar problem with using the JQuery draggable component.
order of js imports was important to making the component work

details here:  http://www.mrvoip.com.au/blog/tapestry-jqueryui-draggable-custom-pages-order-imports-important

hope it's relevant to this topic :)

On 13/08/2012, at 11:19 AM, Ray Nicholus wrote:

> ... I realize that doesn't answer your question though.  Have a look at
> http://tapestry.1045711.n5.nabble.com/Inheritance-and-the-order-of-loaded-JS-td5714430.html
> On Aug 12, 2012 8:12 PM, "Ray Nicholus" <rn...@widen.com> wrote:
> 
>> Jquery should really be part of a JavascriptStack.  in fact, it should
>> probably be its own stack.  You can add any jquery plugins and stylesheets
>> to this stack as well.
>> On Aug 12, 2012 7:51 PM, "Angelo C." <an...@gmail.com> wrote:
>> 
>>> Hi,
>>> 
>>> I have this order of loading:
>>> 
>>> @Import(library = {"context:/js/jquery-1.7.1.js"})
>>> public class Layout { }
>>> 
>>> @Import(library = {"context:/js/page_view.js"})
>>> public class page_view { }
>>> 
>>> page_view extends from Layout template, in the final page html source,
>>> page_view.js is always ahead of jquery-1.7.1.js, is there a way to
>>> re-order
>>> this?
>>> 
>>> Thanks,
>>> 
>>> Angelo
>>> 
>>> 
>>> 
>>> --
>>> View this message in context:
>>> http://tapestry.1045711.n5.nabble.com/loading-order-of-javascripts-tp5715313.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: loading order of javascripts

Posted by Ray Nicholus <rn...@widen.com>.
... I realize that doesn't answer your question though.  Have a look at
http://tapestry.1045711.n5.nabble.com/Inheritance-and-the-order-of-loaded-JS-td5714430.html
On Aug 12, 2012 8:12 PM, "Ray Nicholus" <rn...@widen.com> wrote:

> Jquery should really be part of a JavascriptStack.  in fact, it should
> probably be its own stack.  You can add any jquery plugins and stylesheets
> to this stack as well.
> On Aug 12, 2012 7:51 PM, "Angelo C." <an...@gmail.com> wrote:
>
>> Hi,
>>
>> I have this order of loading:
>>
>> @Import(library = {"context:/js/jquery-1.7.1.js"})
>> public class Layout { }
>>
>> @Import(library = {"context:/js/page_view.js"})
>> public class page_view { }
>>
>> page_view extends from Layout template, in the final page html source,
>> page_view.js is always ahead of jquery-1.7.1.js, is there a way to
>> re-order
>> this?
>>
>> Thanks,
>>
>> Angelo
>>
>>
>>
>> --
>> View this message in context:
>> http://tapestry.1045711.n5.nabble.com/loading-order-of-javascripts-tp5715313.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: loading order of javascripts

Posted by Ray Nicholus <rn...@widen.com>.
Jquery should really be part of a JavascriptStack.  in fact, it should
probably be its own stack.  You can add any jquery plugins and stylesheets
to this stack as well.
On Aug 12, 2012 7:51 PM, "Angelo C." <an...@gmail.com> wrote:

> Hi,
>
> I have this order of loading:
>
> @Import(library = {"context:/js/jquery-1.7.1.js"})
> public class Layout { }
>
> @Import(library = {"context:/js/page_view.js"})
> public class page_view { }
>
> page_view extends from Layout template, in the final page html source,
> page_view.js is always ahead of jquery-1.7.1.js, is there a way to re-order
> this?
>
> Thanks,
>
> Angelo
>
>
>
> --
> View this message in context:
> http://tapestry.1045711.n5.nabble.com/loading-order-of-javascripts-tp5715313.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
>
>