Opened 12 years ago

Closed 12 years ago

Last modified 11 years ago

#4643 closed defect (fixed)

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
Keywords: Declaration Button Cc:
Blocked By: Blocking:

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 (4)

comment:1 Changed 12 years ago by bill

Owner: set to alex

comment:2 Changed 12 years ago by alex

Resolution: fixed
Status: newclosed

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

comment:3 Changed 12 years ago by alex

Milestone: 1.0

comment:4 Changed 11 years ago by Adam Peller

(In [15166]) Fixes #5226, regression of boolean attribute handling in _Templated. Thanks, ptwobrussell! Refs #4643

Note: See TracTickets for help on using tickets.