Ticket #4643 (closed defect: fixed)

Opened 11 months ago

Last modified 10 months ago

IE6/7: "onClick"-Handler for a dijit.form.button declared inside of a dijit.Declarion is broken

Reported by: guest Owned by: alex
Priority: high Milestone: 1.0
Component: Dijit Version: 0.9
Severity: normal Keywords: Declaration Button
Cc:

Description


Version of Dojo: 0.9
verified on nighly-build: no
Browser versions: Bug is reproducable on Internet Explorer 6 and Internet Explorer 7

Description:

Given are two instances of a dijit.form.button. One of them is declared directly in the Markup of the DOM, also a handler for the onClick, that logs the "onClick"-Event in the console. The second button is identical to the first, but is wrapped inside a dijit.Declaration and instanciated in the markup as instance of the declared class.

The page works as expected in Firefox 2. You will get logentries in Firebug, for clicking on each of the buttons. In Internet Explorer 6 and 7 the click on the second button declared inside the dijit.declaration does not show a log-entry in the console, the first button works as expected.

Expected behaviour:

There should be a logentry for each click of the two buttons in Internet Explorer 6 and 7, too.

Testpage:

Make sure to set the src-Attribute of the imported dojo.js-script according to your installation!

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
	"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
	<title>Declaration Test</title>


	<script type="text/javascript" src="../../dojo/dojo.js"
		djConfig="isDebug: true, parseOnLoad: true">
	</script>

	<script type="text/javascript">
		dojo.require("dojo.parser");
		dojo.require("dijit.form.Button");
		dojo.require("dijit.dijit");
		dojo.require("dijit.Declaration");
	</script>
</head>
<body class="tundra">
	
	<p>Test the two buttons with the Internet Explorer 6 or 7. The one declared inside of the dijit.Declaration is not working. Firefox 2 is fine.</p>

	<!-- Declaration of a Widget as Markup -->
	<div dojoType="dijit.Declaration"	widgetClass="DeclarationTest">
		<button dojoType="dijit.form.Button">
			Instance of Button inside a dijit.Declaration
			<script type="dojo/method" event="onClick">
					console.log("This one is inside of the dijit.Declaration");
					console.log(this.id);
			</script>
		</button>
	</div>
	
	<!-- the first button: works on every browser -->
	<button dojoType="dijit.form.Button">
			Instance of Button outside of the dijit.Declaration
			<script type="dojo/method" event="onClick">
					console.log("This one is outside the dijit.Declaration!");
					console.log(this.id);
			</script>
	</button>
        
        <!-- the secon button: works only on firefox -->    
        <div dojoType="DeclarationTest"></div>

</body>
</html>

Change History

Changed 11 months ago by bill

  • owner set to alex

Changed 10 months ago by alex

  • status changed from new to closed
  • resolution set to fixed

(In [10979]) ensure that Declarations always use a string template for construction instead of the potential node-cached variant. Fixes #4643

Changed 10 months ago by alex

  • milestone set to 1.0
Note: See TracTickets for help on using tickets.