I've got a button that displays "HI" when clicked. The button is in a div called "Panel1", which I'm using AJAX to update. After clicking for the first time, when Panel1 is reloaded, the button's click even does not fire anymore. I guess this has to do with event bubbling... but I just can't seem to solve it for the last 3 days. Sample code is as follows:-
<script language="JavaScript" type="text/javascript">
document.observe("dom:loaded", function() {
$$("#ShowDialog").invoke('observe', 'click', function() {
alert("HI");
AjaxPanel.reload($("Panel1"));
});
</script>
</head>
<body>
<div id="Panel1">
.
.
.
<input name="btnAdd" type="submit" value="Add" id="ShowDialog">
</div>
</body>
</html>
Any advice is deeply appreciated.