Opened 9 years ago

Closed 9 years ago

Last modified 8 years ago

#10811 closed defect (wontfix)

dijit.form.DateTextBox issues on Windows 7 Chrome

Reported by: Doug Liu Owned by: bill
Priority: high Milestone: tbd
Component: Dijit - Form Version: 1.4.0
Keywords: Cc: Adam Peller, alex
Blocked By: Blocking:

Description

for the example on:

http://www.dojotoolkit.org/reference-guide/dijit/form/DateTextBox.html#id2

issue:

The 'Changing Constraints on the Fly' example does not work reliably on Windows 7 Chrome (latest version as of 3/3/2010 - version 4.0.249.89). If you use the Chrome javascript console, the error message reads 'Uncaught Illegal Access: native_string.js:183'. There seems to be an issue when two instances of DateTextBox? exist on the same web page...

To reproduce this error, In Chrome on Windows 7, I turn on the Chrome javascript console (Developer > Javascript Console). I click on the 'View Example' button for 'Changing Constraints on the Fly', and wait for the pop-up to load. If it loads successfully, then I close the pop up example window, and click on the 'View Example' button again. (repeat if necessary - it usually takes no more than 10-20 tries). When it fails, I get the 'Uncaught Illegal Access' error in the javascript console, and the pop up example window hangs with the loading animation spinning... Are there any workarounds or is this a bug?

Change History (17)

comment:1 Changed 9 years ago by Adam Peller

Component: GeneralDijit
Owner: changed from anonymous to Douglas Hays

comment:2 Changed 9 years ago by Douglas Hays

Owner: changed from Douglas Hays to bill

I am unable to reproduce this without Chrome's JavaScript? Console activated. It also fails with the latest Chrome 4 on Windows XP. If you close the CodeGlass? execution popup dialog and reattempt it, it will eventually work (at least for me). It has nothing to do with 2 DateTextBox? widgets on the same page since dijit/tests/form/test_DateTextBox.html has several boxes and loads successfully everytime with the Chrome's JavaScript? Console activated. I would suspect a CodeGlass? problem or a Chrome problem.

Assigning to bill to see if he wants to try and narrow down the culprit.

comment:3 Changed 9 years ago by jli

This bug can be resolved by appending the following line:

dojo.requireLocalization("dojo.cldr", "gregorian", "ROOT");

just before the dojo.declare statement.

comment:4 Changed 9 years ago by jli

Just a hint that this bug sometimes cannot be reproduced. It's because gregorian.js does not exist for all available locales (e.g. en-us). If the default locale (ROOT) does not set, error occurs and the date text box will not be initialized. If you set the date text box with an available locale (or nls file exists for your browser locale), no error will be found.

comment:5 Changed 9 years ago by Douglas Hays

Cc: Adam Peller added

comment:6 Changed 9 years ago by Adam Peller

en-us is not present because it does not override anything from en or ROOT. ROOT should be loaded regardless, and the 404's you see when there is no build should be ignored.

comment:7 Changed 9 years ago by Doug Liu

Hi,

Thanks for working on this issue.

I tried adding the dojo.requireLocalization("dojo.cldr","gregorian","ROOT"), but when I try loading the page about 50 times, I still randomly get the 'Uncaught Illegal Access: native_string.js:185' error with Chrome.

When this happens, at least one of the input fields remains a plain input field, instead of being an instance of dijit.form.DateTextBox?.

Here is the source code that I used on a separate test page:

<!DOCTYPE HTML PUBLIC "-W3CDTD HTML 4.01EN" "http://www.w3.org/TR/html4/strict.dtd"> <html dir="ltr">

<head>

<link rel="stylesheet" type="text/css" href="http://ajax.googleapis.com/ajax/libs/dojo/1.4/dijit/themes/tundra/tundra.css"> <style type="text/css">

body, html { font-family:helvetica,arial,sans-serif; font-size:90%; }

</style> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/dojo/1.4/dojo/dojo.xd.js"

djConfig="parseOnLoad: true">

</script> <script type="text/javascript">

dojo.require("dojo.parser"); dojo.require("dijit.form.DateTextBox?"); dojo.requireLocalization("dojo.cldr", "gregorian", "ROOT");

</script>

</head>

<body class="tundra ">

<label for="fromDate">

From:

</label> <input id="fromDate" type="text" name="fromDate" dojoType="dijit.form.DateTextBox?" required="true" onChange="dijit.byId('toDate').constraints.min = arguments[0];" /> <label for="toDate">

To:

</label> <input id="toDate" type="text" name="toDate" dojoType="dijit.form.DateTextBox?" required="true" onChange="dijit.byId('fromDate').constraints.max = arguments[0];" />

</body>

</html>

comment:8 Changed 9 years ago by Doug Liu

I also tried adding locale="en-us" as attributes to the <input> tags, but still have the random "Uncaught Illegal Access: native_string.js:185" issue:

<!DOCTYPE HTML PUBLIC "-W3CDTD HTML 4.01EN" "http://www.w3.org/TR/html4/strict.dtd"> <html dir="ltr">

<head>

<link rel="stylesheet" type="text/css" href="http://ajax.googleapis.com/ajax/libs/dojo/1.4/dijit/themes/tundra/tundra.css"> <style type="text/css">

body, html { font-family:helvetica,arial,sans-serif; font-size:90%; }

</style> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/dojo/1.4/dojo/dojo.xd.js"

djConfig="parseOnLoad: true">

</script> <script type="text/javascript">

dojo.require("dojo.parser"); dojo.require("dijit.form.DateTextBox?"); dojo.requireLocalization("dojo.cldr", "gregorian", "ROOT");

</script>

</head>

<body class="tundra ">

<label for="fromDate">

From:

</label> <input id="fromDate" type="text" name="fromDate" dojoType="dijit.form.DateTextBox?"

required="true" onChange="dijit.byId('toDate').constraints.min = arguments[0];" locale="en-us"

/> <label for="toDate">

To:

</label> <input id="toDate" type="text" name="toDate" dojoType="dijit.form.DateTextBox?"

required="true" onChange="dijit.byId('fromDate').constraints.max = arguments[0];" locale="en-us"

/>

</body> <!-- NOTE: the following script tag is not intended for usage in real world!! it is part of the CodeGlass? and you should just remove it when you use the code -->

</html>

comment:9 Changed 9 years ago by Adam Peller

Cc: alex added

Alex, can you shed any light on this? Should this be pursued as a Chrome bug?

comment:10 Changed 9 years ago by jli

Further update: one more line is required to fix the bug. Here is my code:

dojo.provide("jli.DateTextBox");
dojo.requireLocalization("dojo.cldr", "gregorian", "ROOT");
dojo.requireLocalization("dijit.form", "validate", "ROOT");
dojo.require("dijit.form.DateTextBox");
dojo.declare("jli.DateTextBox", dijit.form.DateTextBox, {
......

comment:11 Changed 9 years ago by Doug Liu

Could you please provide a complete working example of this? I still get the 'Uncaught illegal access: native_string.js:185' issue.

NOTE: I reload the test page (using the code below) 50 times

There should be both declarative style and programmatic style solutions to this issue, right?

<!DOCTYPE HTML PUBLIC "-W3CDTD HTML 4.01EN" "http://www.w3.org/TR/html4/strict.dtd"> <html dir="ltr">

<head>

<link rel="stylesheet" type="text/css" href="http://ajax.googleapis.com/ajax/libs/dojo/1.4/dijit/themes/tundra/tundra.css"> <style type="text/css">

body, html { font-family:helvetica,arial,sans-serif; font-size:90%; }

</style> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/dojo/1.4/dojo/dojo.xd.js"

djConfig="parseOnLoad: true">

</script> <script type="text/javascript">

dojo.require("dojo.parser"); dojo.require("dijit.form.DateTextBox?"); dojo.requireLocalization("dojo.cldr", "gregorian", "ROOT"); dojo.requireLocalization("dijit.form", "validate", "ROOT");

</script>

</head>

<body class="tundra">

<h3>testing dijit.form.DateTextBox?</h3> <label for="fromDate">

From:

</label> <input id="fromDate" type="text" name="fromDate" dojoType="dijit.form.DateTextBox?"

required="true" onChange="dijit.byId('toDate').constraints.min = arguments[0];" locale="en-us"

/> <label for="toDate">

To:

</label> <input id="toDate" type="text" name="toDate" dojoType="dijit.form.DateTextBox?"

required="true" onChange="dijit.byId('fromDate').constraints.max = arguments[0];" locale="en-us"

/>

</body>

</html>

comment:12 Changed 9 years ago by jli

Try this one:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html dir="ltr">

    <head>

        <link rel="stylesheet" type="text/css" href="http://ajax.googleapis.com/ajax/libs/dojo/1.4/dijit/themes/tundra/tundra.css"> <style type="text/css">

            body, html { font-family:helvetica,arial,sans-serif; font-size:90%; }

        </style> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/dojo/1.4/dojo/dojo.xd.js"

                djConfig="parseOnLoad: true">

        </script> <script type="text/javascript">
		dojo.require("dijit.dijit");

                dojo.require("dojo.parser"); dojo.require("dijit.form.DateTextBox"); dojo.requireLocalization("dojo.cldr", "gregorian", "ROOT"); dojo.requireLocalization("dijit.form", "validate", "ROOT");

        </script>

    </head>

    <body class="tundra">

        <h3>testing dijit.form.DateTextBox</h3> <label for="fromDate">

            From:

        </label> <input id="fromDate" type="text" name="fromDate" dojoType="dijit.form.DateTextBox"

                required="true" onChange="dijit.byId('toDate').constraints.min = arguments[0];" locale="en-us"

        /> <label for="toDate">

            To:

        </label> <input id="toDate" type="text" name="toDate" dojoType="dijit.form.DateTextBox"

                required="true" onChange="dijit.byId('fromDate').constraints.max = arguments[0];" locale="en-us"

        />

    </body>

</html> 

comment:13 Changed 9 years ago by Doug Liu

Hi All,

This sample code works great for the latest Chrome (5.0.342.9) on OS X Snow Leopard, but on the latest Chrome (4.1.249.1045) for Windows 7, I still get 'uncaught illegal access' about 20% to 30% of all the times that I have reloaded the page.

Hope this helps, Doug

comment:14 Changed 9 years ago by robg

I was experiencing this same issue in Chrome 5.0.342.9 beta on Ubuntu and spent a couple days banging my head against it. I've also repro'd this issue on Chrome 5.0.342.7 beta (Ubuntu), and Chrome 4.1.249.1025 (WinXP). The requireLocalization changes seem to help, but didn't clear up the issue completely.

Using a local roll-up with dojo 1.4.2, I tracked the issue to the pattern.replace in locale.js, line 497. The fact that the 'illegal access' originates in Chrome JS/native code that's called from 'replace' seems to suggest that the issue is a Chrome bug, and not a dojo bug (I think).

The bug I filed with Chromium is here: http://code.google.com/p/chromium/issues/detail?id=42370

comment:15 Changed 9 years ago by Doug Liu

Good news: I tested the latest Chrome (Win 7: 5.0.375.55) and (OS X: 5.0.375.55) and the issue has been resolved...dijit.form.DateTextBox? is reliable now.

I tested the issue with: http://docs.dojocampus.org/dijit/form/DateTextBox, and with my own test code w/dojo 1.4.2 and the issue has been resolved.

Thanks for all your help!

comment:16 Changed 9 years ago by bill

Resolution: wontfix
Status: newclosed

OK great, closing this ticket then, since the browser bug was fixed there's no need to update dojo.

comment:17 Changed 8 years ago by bill

Component: DijitDijit - Form
Note: See TracTickets for help on using tickets.