Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#7803 closed defect (duplicate)

Dojo 1.2 regression - widgets added programmatically to ContentPane are not destroyed

Reported by: Les Owned by:
Priority: blocker Milestone: tbd
Component: Dijit Version: 1.2beta
Keywords: Cc:
Blocked By: Blocking:

Description

Steps to recreate:

  1. Click the 'add button' button.
  1. Click the 'set content' button.
  1. Enter dijit.byId('button') in Firebug's console

You will see that the newly added button is not destroyed.

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

	<style>
		@import "../../../dojo/resources/dojo.css";
		@import "../css/dijitTests.css";
	</style>
	
	<!-- required: the default dijit theme: -->
	<link id="themeStyles" rel="stylesheet" href="../../../dijit/themes/tundra/tundra.css">

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

	<!-- only needed for alternate theme testing: do NOT use in your code! -->
	<script type="text/javascript" src="../_testCommon.js"></script>

	<script type="text/javascript">
		dojo.require("dijit.dijit"); // optimize: load dijit layer
		dojo.require("dijit.form.Button");
		dojo.require("dijit.form.ComboBox");
		dojo.require("dijit.layout.ContentPane");
		dojo.require("dojo.parser");	// scan page for widgets and instantiate them

		var cp;
		
		function addButton() {
			new dijit.form.Button({ id: 'button', label:"New Button" }).placeAt(dijit.byId('pane').domNode);
		}

		dojo.addOnLoad(function(){
			cp = new dijit.layout.ContentPane({
				id: "pane",
				content: "hello world",
				style: "border: solid black thin;"
			});
			dojo.body().appendChild(cp.domNode);
		});
	</script>
	
</head>
<body class="tundra">
	
	<h1 class="testTitle">Dijit layout.ContentPane programmatic tests</h1>

	<button onclick="addButton()">add button</button>
	<button onclick="cp.attr('content', 'hi there !!!')">set content</button>

</body>
</html>

Change History (3)

comment:1 Changed 11 years ago by Les

This ticket is the same as 7784

http://trac.dojotoolkit.org/ticket/7784

comment:2 Changed 11 years ago by Karl Tiedt

Resolution: duplicate
Status: newclosed

thanks for pointing that out Les

comment:3 Changed 11 years ago by Adam Peller

Milestone: 1.2.1tbd
Note: See TracTickets for help on using tickets.