lazybubblepublish.html revision ef53d6bba1a117c23e9ba697b08e15eee1ee9c06
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
<html>
<head>
<title>Nested Widget Example</title>
</head>
<body class="yui-skin-sam">
<button id="test">Test</button>
<script type="text/javascript">
YUI({
filter: "raw"
}).use("widget", "widget-parent", "widget-child", function (Y) {
var root = new Parent();
root.add(new Parent());
root.add(new Child());
root.item(0).get("contentBox").set("innerHTML", "Child One");
root.item(1).get("contentBox").set("innerHTML", "Child Two");
root.render();
// The following two listeners will not be called if
// line 481 of Widget.js is commented out
root.on("child:click", function (e) {
alert("You clicked: " + e.domEvent);
});
root.on("parent:click", function (e) {
alert("You clicked: " + e.domEvent);
});
});
</script>
</body>
</html>