[T5.1.0.5] 'Tapestry' is undefined JavaScript error on form submit

View: New views
7 Messages — Rating Filter:   Alert me  

[T5.1.0.5] 'Tapestry' is undefined JavaScript error on form submit

by Eric Ma :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I have a simple form:

<form t:id="myForm" t:type="Form">

T5.1.0.5 turns it into:

<form enctype="application/x-www-form-urlencoded" onsubmit="javascript:Tapestry.waitForPage(event);" action="../myClass" method="post" id="myForm" name="myForm">

What is this extra bit onsubmit="javascript:Tapestry.waitForPage(event);" for?  IE 7 gives a runtime JS error: 'Tapestry' is undefined.  However, the form gets submiited properly.  So this is not a show-stopper.  It is simply an annoyance.

Any suggestion how to suppress this event handler?  Thanks,

Eric

Re: [T5.1.0.5] 'Tapestry' is undefined JavaScript error on form submit

by Howard Lewis Ship :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

That's odd because I've tested this under IE 7 and it works.  Anyone
else seeing this?

On Tue, Jun 2, 2009 at 7:44 AM, Eric Ma <eric.ma@...> wrote:

>
> I have a simple form:
>
> <form t:id="myForm" t:type="Form">
>
> T5.1.0.5 turns it into:
>
> <form enctype="application/x-www-form-urlencoded"
> onsubmit="javascript:Tapestry.waitForPage(event);" action="../myClass"
> method="post" id="myForm" name="myForm">
>
> What is this extra bit onsubmit="javascript:Tapestry.waitForPage(event);"
> for?  IE 7 gives a runtime JS error: 'Tapestry' is undefined.  However, the
> form gets submiited properly.  So this is not a show-stopper.  It is simply
> an annoyance.
>
> Any suggestion how to suppress this event handler?  Thanks,
>
> Eric
> --
> View this message in context: http://www.nabble.com/-T5.1.0.5--%27Tapestry%27-is-undefined-JavaScript-error-on-form-submit-tp23834056p23834056.html
> Sent from the Tapestry - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@...
> For additional commands, e-mail: users-help@...
>
>



--
Howard M. Lewis Ship

Creator of Apache Tapestry
Director of Open Source Technology at Formos

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


Re: [T5.1.0.5] 'Tapestry' is undefined JavaScript error on form submit

by Eric Ma :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Howard Lewis Ship wrote:
That's odd because I've tested this under IE 7 and it works.  Anyone
else seeing this?

Howard M. Lewis Ship

Creator of Apache Tapestry
Director of Open Source Technology at Formos
Thanks for the reply Howard.  One thing I notice is on the page where this JS error occurs, the <form> element is in a custom component, not in the page directly.  In all other pages with <form> elements, IE 7 is perfectly fine with the onsubmit event handler.

So it appears somehow the main Tapestry.js file is not included properly with components.

Re: [T5.1.0.5] 'Tapestry' is undefined JavaScript error on form submit

by Howard Lewis Ship :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Well, you could verify that with a "view source"; it seems unlikely to
me, but that would be a start towards investigating this.

On Tue, Jun 2, 2009 at 8:44 AM, Eric Ma <eric.ma@...> wrote:

>
>
>
> Howard Lewis Ship wrote:
>>
>> That's odd because I've tested this under IE 7 and it works.  Anyone
>> else seeing this?
>>
>> Howard M. Lewis Ship
>>
>> Creator of Apache Tapestry
>> Director of Open Source Technology at Formos
>>
>
> Thanks for the reply Howard.  One thing I notice is on the page where this
> JS error occurs, the <form> element is in a custom component, not in the
> page directly.  In all other pages with <form> elements, IE 7 is perfectly
> fine with the onsubmit event handler.
>
> So it appears somehow the main Tapestry.js file is not included properly
> with components.
>
> --
> View this message in context: http://www.nabble.com/-T5.1.0.5--%27Tapestry%27-is-undefined-JavaScript-error-on-form-submit-tp23834056p23835288.html
> Sent from the Tapestry - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@...
> For additional commands, e-mail: users-help@...
>
>



--
Howard M. Lewis Ship

Creator of Apache Tapestry
Director of Open Source Technology at Formos

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


Re: [T5.1.0.5] 'Tapestry' is undefined JavaScript error on form submit

by Thiago H. de Paula Figueiredo :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Em Tue, 02 Jun 2009 14:06:58 -0300, Howard Lewis Ship <hlship@...>  
escreveu:

> Well, you could verify that with a "view source"; it seems unlikely to
> me, but that would be a start towards investigating this.

This problem can also be cause by some previous Javascript error. Using  
Firebug and/or Web Developer can help to figure out what's happening.

--
Thiago H. de Paula Figueiredo
Independent Java consultant, developer, and instructor
http://www.arsmachina.com.br/thiago

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


Re: [T5.1.0.5] 'Tapestry' is undefined JavaScript error on form submit

by Sergey Didenko :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I created an issue about this problem a few days ago:

https://issues.apache.org/jira/browse/TAP5-712

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


Re: [T5.1.0.5] 'Tapestry' is undefined JavaScript error on form submit

by Eric Ma :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Howard Lewis Ship wrote:
Well, you could verify that with a "view source"; it seems unlikely to
me, but that would be a start towards investigating this.

Howard M. Lewis Ship
Well, I had never had the need to explicitly include tapestry.js, until today that is. T5 apparently does its magic behind the scenes.  Plus, when doing View Source for the pages in which the onsubmit handler works, I cannot find tapestry.js.

After explicitly adding @IncludeJavaScriptLibrary({"classpath:org/apache/tapestry5/tapestry.js"}) to the custom component, my problem is now resolved.  Howard, does that give you a clue how to solve the problem at the root level?

Eric