I'm using Struts 2.1.0, and I want to use the dojo widget dialog.
I try this simple code:
<[EMAIL PROTECTED] prefix="sx" uri="/struts-dojo-tags" %>
<html>
<head>
<sx:head debug="true"/>
<script type="text/javascript">
dojo.require("dojo.widget.Dialog");
var dlg;
function init() {
dlg = dojo.widget.byId("dialogContent");
dojo.debug("dlg="+dlg);
alert(dlg+" "+document.getElementById("dialogContent"));
}
dojo.addOnLoad(init);
</script>
</head>
<body>
<a href="javascript:dlg.show()">Show</a>
<div dojoType="Dialog" id="dialogContent" bgColor="grey" bgOpacity="0.5"
toggle="fade" toggleDuration="250" closeOnBackgroundClick="true">
Hello World!
</div>
</body>
</html>
But the variable dlg is always undefined (but with the
document.getElementById("dialogContent"), the div is correctly present)
How I can correctly use the widget dialog into Struts 2.1.0 ?
Best regards
Arnaud