i knew that would come :)  i 'm watching the progress closely; it'll
be a great leap forward in developing js heavy applications.

sometimes there is an easier solution... i just added window._ = T5._
into my copy of backbone.js. i think i was looking to hard to add it
without modifying the original file and using the JavascriptSupport
service for that purpose.

thank you
g,
kris




On Mon, Nov 5, 2012 at 8:47 PM, Howard Lewis Ship <hls...@gmail.com> wrote:
> Needless to say, this will not be a problem in 5.4.
>
>
> On Mon, Nov 5, 2012 at 11:47 AM, Howard Lewis Ship <hls...@gmail.com> wrote:
>
>> I had to put in place a shim before the import of backbone, to fix this:
>>
>> /**
>>  * T5 is nice enough to use Underscore in noConflict() mode, but Backbone
>> expects it to be visible as window._, so we hack that.
>>  */
>> window._ = T5._;
>>
>>
>> On Mon, Nov 5, 2012 at 11:35 AM, Kristian Marinkovic <
>> kristian.marinko...@gmail.com> wrote:
>>
>>> Hi,
>>>
>>> i need some advice on how to properly integrate backbone.js in my T5
>>> application.
>>>
>>> Adding backbone.js with the @Import annotation results in an console
>>> error because it can't find the global underscore object _. The reason
>>> for that is the mapping of underscore to the T5 namespace in
>>> t5-core.js. When i tried to replace the core javascript stack i
>>> realized that it was already overridden by tapestry5-jquery. My quick
>>> workaround is to add the assets underscore.js and backbone.js manually
>>> using JavascriptSupport; this way i can control the order and _ is
>>> initialized globally again, but underscore is included twice in my
>>> pages.
>>>
>>>     void afterRender()
>>>     {
>>>         jsSupport.importJavaScriptLibrary(underscore);
>>>         jsSupport.importJavaScriptLibrary(backbone);
>>>     }
>>>
>>> How could i solve this problem differently? Is anyone using T5 with
>>> backbone already? I'd be interested how the view templates are
>>> handled.
>>>
>>> g,
>>> Kris
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
>>> For additional commands, e-mail: users-h...@tapestry.apache.org
>>>
>>>
>>
>>
>> --
>> Howard M. Lewis Ship
>>
>> Creator of Apache Tapestry
>>
>> The source for Tapestry training, mentoring and support. Contact me to
>> learn how I can get you up and productive in Tapestry fast!
>>
>> (971) 678-5210
>> http://howardlewisship.com
>>
>
>
>
> --
> Howard M. Lewis Ship
>
> Creator of Apache Tapestry
>
> The source for Tapestry training, mentoring and support. Contact me to
> learn how I can get you up and productive in Tapestry fast!
>
> (971) 678-5210
> http://howardlewisship.com

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

Reply via email to