You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Cheng Zhang <ch...@gmail.com> on 2015/03/20 00:28:32 UTC

JS conflict

Hi all,

I am trying to apply Foundation framework to an existing Tapestry project.
But the JavaScript usded by Foundation seems like conflict with Tapestry JS.

Once I added the Foundataion JS file to my tml file, the eventlink does no
longer work, there is no any response after cliking, and Eclipse console
has no output.

I believe the http://foundation.zurb.com/docs/assets/js/all.js makes some
negative effect on the existing JS function Tapestry.waitForPage.

The tml file eventlink code:

<a t:type=*"eventlink"* t:event=*"resetPassword"* t:zone=*"editZone"*
t:update=*"show"* href=*"#"*>Forgot Password</a>
In browser the generated html code:

<a id="eventlink" onclick="javascript:return Tapestry.waitForPage(event);"
update="show" href="/portal/signin:resetpassword">Forgot Password</a>

Thanks for your help!

Charles

Re: JS conflict

Posted by Thiago H de Paula Figueiredo <th...@gmail.com>.
On Tue, 31 Mar 2015 01:37:58 -0300, Cheng Zhang  
<ch...@gmail.com> wrote:

> Thanks for reminding me Thiago. I do not know if my company will use the
> non-stable version of Tapestry in production.

It is stable very much. :)

-- 
Thiago H. de Paula Figueiredo
Tapestry, Java and Hibernate consultant and developer
http://machina.com.br

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


Re: JS conflict

Posted by Cheng Zhang <ch...@gmail.com>.
Thanks for reminding me Thiago. I do not know if my company will use the
non-stable version of Tapestry in production.

On Mon, Mar 30, 2015 at 1:00 PM, Thiago H de Paula Figueiredo <
thiagohp@gmail.com> wrote:

> On Fri, 20 Mar 2015 14:29:09 -0300, Cheng Zhang <
> charlesdenverjava@gmail.com> wrote:
>
>  I just made some research and found the Tapestry is tightly coupling with
>> Prototype,
>>
>
> This is absolutely not correct for Tapestry 5.4, which is a recommended
> upgrade (at least by me).
>
>
> --
> Thiago H. de Paula Figueiredo
> Tapestry, Java and Hibernate consultant and developer
> http://machina.com.br
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>

Re: JS conflict

Posted by Thiago H de Paula Figueiredo <th...@gmail.com>.
On Fri, 20 Mar 2015 14:29:09 -0300, Cheng Zhang  
<ch...@gmail.com> wrote:

> I just made some research and found the Tapestry is tightly coupling with
> Prototype,

This is absolutely not correct for Tapestry 5.4, which is a recommended  
upgrade (at least by me).

-- 
Thiago H. de Paula Figueiredo
Tapestry, Java and Hibernate consultant and developer
http://machina.com.br

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


Re: JS conflict

Posted by Cheng Zhang <ch...@gmail.com>.
Found another article showing it is possible to use jQuery in addition to
Prototype. I will try.

http://tapestry.apache.org/legacy-javascript.html

On Fri, Mar 20, 2015 at 11:29 AM, Cheng Zhang <ch...@gmail.com>
wrote:

> I am not sure. I even did not realize Tapestry use Prototype as its
> default JS library.
> I do not want to change existing code with built-in prototype.
> I just made some research and found the Tapestry is tightly coupling with
> Prototype, probably I can only use the Foundation components that do not
> require JS.
>
>
> https://tapestry.apache.org/javascript-rewrite.html#JavaScriptRewrite-DependenceonPrototype/Scriptaculous
>
> Thank you so much Thiago.
>
>
> On Fri, Mar 20, 2015 at 6:54 AM, Thiago H de Paula Figueiredo <
> thiagohp@gmail.com> wrote:
>
>> Are you sure Foundation Framework is compatible with Prototype.js? If
>> not, and if it's compatible with jQuery, you can make Tapestry 5.4 use
>> jQuery instead. Not exactly a Tapestry problem.
>>
>>
>> On Thu, 19 Mar 2015 20:38:02 -0300, Cheng Zhang <
>> charlesdenverjava@gmail.com> wrote:
>>
>>  More information from dev tool Console:
>>>
>>> Uncaught TypeError: undefined is not a function     prototype.js:2284
>>> Element.Methods.writeAttribute
>>>  prototype.js:2284
>>> global.Element
>>>  prototype.js:1898
>>> Tapestry.waitForPage
>>> tapestry.js:120
>>>
>>> onclick
>>> (index):7
>>> a.sendClick
>>> all.js:34
>>> a.onTouchEnd
>>> all.js:34
>>>
>>> d
>>> all.js:34
>>>
>>> On Thu, Mar 19, 2015 at 5:28 PM, Cheng Zhang <
>>> charlesdenverjava@gmail.com>
>>> wrote:
>>>
>>>  Hi all,
>>>>
>>>> I am trying to apply Foundation framework to an existing Tapestry
>>>> project.
>>>> But the JavaScript usded by Foundation seems like conflict with
>>>> Tapestry JS.
>>>>
>>>> Once I added the Foundataion JS file to my tml file, the eventlink does
>>>> no
>>>> longer work, there is no any response after cliking, and Eclipse console
>>>> has no output.
>>>>
>>>> I believe the http://foundation.zurb.com/docs/assets/js/all.js makes
>>>> some
>>>> negative effect on the existing JS function Tapestry.waitForPage.
>>>>
>>>> The tml file eventlink code:
>>>>
>>>> <a t:type=*"eventlink"* t:event=*"resetPassword"* t:zone=*"editZone"*
>>>> t:update=*"show"* href=*"#"*>Forgot Password</a>
>>>> In browser the generated html code:
>>>>
>>>> <a id="eventlink" onclick="javascript:return
>>>> Tapestry.waitForPage(event);"
>>>> update="show" href="/portal/signin:resetpassword">Forgot Password</a>
>>>>
>>>> Thanks for your help!
>>>>
>>>> Charles
>>>>
>>>>
>>
>> --
>> Thiago H. de Paula Figueiredo
>> Tapestry, Java and Hibernate consultant and developer
>> http://machina.com.br
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>>
>

Re: JS conflict

Posted by Cheng Zhang <ch...@gmail.com>.
I am not sure. I even did not realize Tapestry use Prototype as its default
JS library.
I do not want to change existing code with built-in prototype.
I just made some research and found the Tapestry is tightly coupling with
Prototype, probably I can only use the Foundation components that do not
require JS.

https://tapestry.apache.org/javascript-rewrite.html#JavaScriptRewrite-DependenceonPrototype/Scriptaculous

Thank you so much Thiago.


On Fri, Mar 20, 2015 at 6:54 AM, Thiago H de Paula Figueiredo <
thiagohp@gmail.com> wrote:

> Are you sure Foundation Framework is compatible with Prototype.js? If not,
> and if it's compatible with jQuery, you can make Tapestry 5.4 use jQuery
> instead. Not exactly a Tapestry problem.
>
>
> On Thu, 19 Mar 2015 20:38:02 -0300, Cheng Zhang <
> charlesdenverjava@gmail.com> wrote:
>
>  More information from dev tool Console:
>>
>> Uncaught TypeError: undefined is not a function     prototype.js:2284
>> Element.Methods.writeAttribute
>>  prototype.js:2284
>> global.Element
>>  prototype.js:1898
>> Tapestry.waitForPage
>> tapestry.js:120
>>
>> onclick
>> (index):7
>> a.sendClick
>> all.js:34
>> a.onTouchEnd
>> all.js:34
>>
>> d
>> all.js:34
>>
>> On Thu, Mar 19, 2015 at 5:28 PM, Cheng Zhang <charlesdenverjava@gmail.com
>> >
>> wrote:
>>
>>  Hi all,
>>>
>>> I am trying to apply Foundation framework to an existing Tapestry
>>> project.
>>> But the JavaScript usded by Foundation seems like conflict with Tapestry
>>> JS.
>>>
>>> Once I added the Foundataion JS file to my tml file, the eventlink does
>>> no
>>> longer work, there is no any response after cliking, and Eclipse console
>>> has no output.
>>>
>>> I believe the http://foundation.zurb.com/docs/assets/js/all.js makes
>>> some
>>> negative effect on the existing JS function Tapestry.waitForPage.
>>>
>>> The tml file eventlink code:
>>>
>>> <a t:type=*"eventlink"* t:event=*"resetPassword"* t:zone=*"editZone"*
>>> t:update=*"show"* href=*"#"*>Forgot Password</a>
>>> In browser the generated html code:
>>>
>>> <a id="eventlink" onclick="javascript:return
>>> Tapestry.waitForPage(event);"
>>> update="show" href="/portal/signin:resetpassword">Forgot Password</a>
>>>
>>> Thanks for your help!
>>>
>>> Charles
>>>
>>>
>
> --
> Thiago H. de Paula Figueiredo
> Tapestry, Java and Hibernate consultant and developer
> http://machina.com.br
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>

Re: JS conflict

Posted by Thiago H de Paula Figueiredo <th...@gmail.com>.
Are you sure Foundation Framework is compatible with Prototype.js? If not,  
and if it's compatible with jQuery, you can make Tapestry 5.4 use jQuery  
instead. Not exactly a Tapestry problem.

On Thu, 19 Mar 2015 20:38:02 -0300, Cheng Zhang  
<ch...@gmail.com> wrote:

> More information from dev tool Console:
>
> Uncaught TypeError: undefined is not a function     prototype.js:2284
> Element.Methods.writeAttribute                                
> prototype.js:2284
> global.Element
>  prototype.js:1898
> Tapestry.waitForPage
> tapestry.js:120
>
> onclick
> (index):7
> a.sendClick
> all.js:34
> a.onTouchEnd
> all.js:34
>
> d
> all.js:34
>
> On Thu, Mar 19, 2015 at 5:28 PM, Cheng Zhang  
> <ch...@gmail.com>
> wrote:
>
>> Hi all,
>>
>> I am trying to apply Foundation framework to an existing Tapestry  
>> project.
>> But the JavaScript usded by Foundation seems like conflict with  
>> Tapestry JS.
>>
>> Once I added the Foundataion JS file to my tml file, the eventlink does  
>> no
>> longer work, there is no any response after cliking, and Eclipse console
>> has no output.
>>
>> I believe the http://foundation.zurb.com/docs/assets/js/all.js makes  
>> some
>> negative effect on the existing JS function Tapestry.waitForPage.
>>
>> The tml file eventlink code:
>>
>> <a t:type=*"eventlink"* t:event=*"resetPassword"* t:zone=*"editZone"*
>> t:update=*"show"* href=*"#"*>Forgot Password</a>
>> In browser the generated html code:
>>
>> <a id="eventlink" onclick="javascript:return  
>> Tapestry.waitForPage(event);"
>> update="show" href="/portal/signin:resetpassword">Forgot Password</a>
>>
>> Thanks for your help!
>>
>> Charles
>>


-- 
Thiago H. de Paula Figueiredo
Tapestry, Java and Hibernate consultant and developer
http://machina.com.br

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


Re: JS conflict

Posted by Cheng Zhang <ch...@gmail.com>.
More information from dev tool Console:

Uncaught TypeError: undefined is not a function     prototype.js:2284
Element.Methods.writeAttribute                               prototype.js:2284
global.Element
 prototype.js:1898
Tapestry.waitForPage
tapestry.js:120

onclick
(index):7
a.sendClick
all.js:34
a.onTouchEnd
all.js:34

d
all.js:34

On Thu, Mar 19, 2015 at 5:28 PM, Cheng Zhang <ch...@gmail.com>
wrote:

> Hi all,
>
> I am trying to apply Foundation framework to an existing Tapestry project.
> But the JavaScript usded by Foundation seems like conflict with Tapestry JS.
>
> Once I added the Foundataion JS file to my tml file, the eventlink does no
> longer work, there is no any response after cliking, and Eclipse console
> has no output.
>
> I believe the http://foundation.zurb.com/docs/assets/js/all.js makes some
> negative effect on the existing JS function Tapestry.waitForPage.
>
> The tml file eventlink code:
>
> <a t:type=*"eventlink"* t:event=*"resetPassword"* t:zone=*"editZone"*
> t:update=*"show"* href=*"#"*>Forgot Password</a>
> In browser the generated html code:
>
> <a id="eventlink" onclick="javascript:return Tapestry.waitForPage(event);"
> update="show" href="/portal/signin:resetpassword">Forgot Password</a>
>
> Thanks for your help!
>
> Charles
>