Subversion Repositories Applications.papyrus

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
2150 mathias 1
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
2
	"http://www.w3.org/TR/html4/strict.dtd">
3
<html>
4
	<head>
5
		<title>Dojo ComboBox Widget Destruction Issue</title>
6
 
7
		<style type="text/css">
8
			@import "../../../dojo/resources/dojo.css";
9
			@import "../css/dijitTests.css";
10
		</style>
11
		<script type="text/javascript" src="../../../dojo/dojo.js"
12
			djConfig="isDebug: true, parseOnLoad: true"></script>
13
		<script type="text/javascript" src="../_testCommon.js"></script>
14
 
15
		<script type="text/javascript">
16
			dojo.require("dijit.form.ComboBox");
17
			dojo.require("dojo.parser");	// scan page for widgets and instantiate them
18
 
19
			dojo.addOnLoad(function(){
20
				dojo.connect(dojo.byId("killit"), "onclick", function(){
21
					dijit.byId("combo_01").destroy(true);
22
				});
23
			});
24
		</script>
25
	</head>
26
	<body>
27
		<h1>Dojo ComboBox Widget Destruction Issue</h1>
28
		<p>
29
			<tt>ComboBox</tt> does not destroy itself properly, leading to a
30
			JavaScript error.  Could it have something to do with not disconnecting
31
			events?
32
		</p>
33
		<p></p>
34
		Steps:
35
		<ol>
36
			<li>Pick a state from the combo box below.</li>
37
			<li>Click the "killit" button, which calls <tt>destroy</tt> on the widget.</li>
38
			<li>Observe the JavaScript error.</li>
39
		</ol>
40
		<p></p>
41
		<form action="#" method="GET">
42
		   <input type="button" id="killit" name="killit" value="killit" />
43
			<select name="state" searchField="name" keyField="abbreviation"
44
				id="combo_01" dojoType="dijit.form.ComboBox" style="width: 300px;"
45
				name="foo.bar1" autoComplete="false">
46
				<option value="AL">Alabama</option>
47
 
48
				<option value="AK">Alaska</option>
49
				<option value="AS">American Samoa</option>
50
				<option value="AZ">Arizona</option>
51
				<option value="AR">Arkansas</option>
52
				<option value="AE">Armed Forces Europe</option>
53
				<option value="AP">Armed Forces Pacific</option>
54
			</select>
55
		</form>
56
	</body>
57
</html>