You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by "Poder, Jacob" <ja...@thermofisher.com> on 2012/06/11 09:43:07 UTC

[5.3] JSONArray Error while submitting forms

Hi,

I'm having the problem described here: https://issues.apache.org/jira/browse/TAP5-1777

The issue has been closed as not a problem, but I'm still getting this error even though I cleared browser cache as suggested. The error happens in IE8 and IE9 but not in Firefox or Chrome.
For me It's easily reproducible, so would someone please try below Tapestry page example in an IE browser?


1)      Submit the form (using the default value of 0), by pressing enter

2)      A validation error is shown (validate="min=1")

3)      Change the value to a positive number, e.g. 10 and resubmit.

The result is an exception "A JSONArray text must start with '[' at character 1 of null".

Thank you,
Jacob


// Test.java
public class Test {

     @Property
     private int rowsPerPage;
}


// Test.tml
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:t="http://tapestry.apache.org/schema/tapestry_5_1_0.xsd">
<head>
     <title>Form test</title>
</head>
<body>

     <t:form t:id="pageSizeForm" >
           <t:textfield t:id="pagesize" value="rowsPerPage" validate="min=1" />
     </t:form>

</body>
</html>

Re: [5.3] JSONArray Error while submitting forms

Posted by Muhammad Gelbana <m....@gmail.com>.
Are you packaging your application using maven ? Try to make a clean build
(mvn clean)

On Tue, Jun 12, 2012 at 11:02 AM, Poder, Jacob <jacob.poder@thermofisher.com
> wrote:

> Aha, the error ONLY occurs when the form is submitted by pressing return!
>
> So, 3 conditions to make this happen:
> 1) IE8/9 browser
> 2) Submit form using return button
> 3) A validator (e.g. required/min/max) must have failed immediately before
>
> Best regards,
> Jacob
>
> T5.3.3
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>


-- 
*Regards,*
*Muhammad Gelbana
Java Developer*

RE: [5.3] JSONArray Error while submitting forms

Posted by "Poder, Jacob" <ja...@thermofisher.com>.
Aha, the error ONLY occurs when the form is submitted by pressing return!

So, 3 conditions to make this happen:
1) IE8/9 browser
2) Submit form using return button
3) A validator (e.g. required/min/max) must have failed immediately before

Best regards,
Jacob

T5.3.3

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


RE: [5.3] JSONArray Error while submitting forms

Posted by "Poder, Jacob" <ja...@thermofisher.com>.
Thank you for replying, it's much appreciated.

I did upgrade from earlier Tapestry versions as they were released. The code that fails was only added after the latest upgrade (5.3.3) so I can't say if it would fail on older versions.
I made sure to clear browser cache and I also changed the SymbolConstants.APPLICATION_VERSION to ensure a new path for all scripts etc. I have tested that this error happens on 3 different PCs, so browser cache is really not likely to be the culprit.

I hadn't set the SymbolConstants.MINIFICATION_ENABLED, but changing SymbolConstants.PRODUCTION_MODE implicitly changes MINIFICATION_ENABLED accordingly and the error happens both in development and production mode. I did try both true/false for MINIFICATION_ENABLED afterwards, but same result.

I also tested with "tapestry.compress-whitespace" true/false to see it that would make a difference, but no...

Please note that the error only occurs when the form field's validate requirement is not met. This causes setSubmittingElement (tapestry.js, line 1545) to be called with null argument. This again adds a hidden null-value named "t:submit" to the form. The exception then happens in isFormCancelled() (Form.java, line 590) where the value of "t:submit" is literal "null" in IE 8/9 and not simply null as in Firefox/Chrome.

Again, if someone could try out the simple Tapestry page below in 5.3.3 and IE 8/9, I would love to hear the result?

Best regards,
Jacob

-----Original Message-----
From: Muhammad Gelbana [mailto:m.gelbana@gmail.com] 
Sent: Monday, June 11, 2012 5:22 PM
To: Tapestry users
Subject: Re: [5.3] JSONArray Error while submitting forms

How did this start happening ? Did you just modify the class path from pointing to an older tapestry version to a newer one ?

Please state your app configuration. Things like:
*SymbolConstants.MINIFICATION_ENABLED*


On Mon, Jun 11, 2012 at 9:43 AM, Poder, Jacob
<ja...@thermofisher.com>wrote:

> Hi,
>
> I'm having the problem described here:
> https://issues.apache.org/jira/browse/TAP5-1777
>
> The issue has been closed as not a problem, but I'm still getting this 
> error even though I cleared browser cache as suggested. The error 
> happens in IE8 and IE9 but not in Firefox or Chrome.
> For me It's easily reproducible, so would someone please try below 
> Tapestry page example in an IE browser?
>
>
> 1)      Submit the form (using the default value of 0), by pressing enter
>
> 2)      A validation error is shown (validate="min=1")
>
> 3)      Change the value to a positive number, e.g. 10 and resubmit.
>
> The result is an exception "A JSONArray text must start with '[' at 
> character 1 of null".
>
> Thank you,
> Jacob
>
>
> // Test.java
> public class Test {
>
>     @Property
>     private int rowsPerPage;
> }
>
>
> // Test.tml
> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "
> http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:t="
> http://tapestry.apache.org/schema/tapestry_5_1_0.xsd">
> <head>
>     <title>Form test</title>
> </head>
> <body>
>
>     <t:form t:id="pageSizeForm" >
>           <t:textfield t:id="pagesize" value="rowsPerPage"
> validate="min=1" />
>     </t:form>
>
> </body>
> </html>
>



--
*Regards,*
*Muhammad Gelbana
Java Developer*

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


Re: [5.3] JSONArray Error while submitting forms

Posted by Muhammad Gelbana <m....@gmail.com>.
How did this start happening ? Did you just modify the class path from
pointing to an older tapestry version to a newer one ?

Please state your app configuration. Things like:
*SymbolConstants.MINIFICATION_ENABLED*


On Mon, Jun 11, 2012 at 9:43 AM, Poder, Jacob
<ja...@thermofisher.com>wrote:

> Hi,
>
> I'm having the problem described here:
> https://issues.apache.org/jira/browse/TAP5-1777
>
> The issue has been closed as not a problem, but I'm still getting this
> error even though I cleared browser cache as suggested. The error happens
> in IE8 and IE9 but not in Firefox or Chrome.
> For me It's easily reproducible, so would someone please try below
> Tapestry page example in an IE browser?
>
>
> 1)      Submit the form (using the default value of 0), by pressing enter
>
> 2)      A validation error is shown (validate="min=1")
>
> 3)      Change the value to a positive number, e.g. 10 and resubmit.
>
> The result is an exception "A JSONArray text must start with '[' at
> character 1 of null".
>
> Thank you,
> Jacob
>
>
> // Test.java
> public class Test {
>
>     @Property
>     private int rowsPerPage;
> }
>
>
> // Test.tml
> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "
> http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:t="
> http://tapestry.apache.org/schema/tapestry_5_1_0.xsd">
> <head>
>     <title>Form test</title>
> </head>
> <body>
>
>     <t:form t:id="pageSizeForm" >
>           <t:textfield t:id="pagesize" value="rowsPerPage"
> validate="min=1" />
>     </t:form>
>
> </body>
> </html>
>



-- 
*Regards,*
*Muhammad Gelbana
Java Developer*