Your code likes fine so it appears that dojo has not parsed the html for widgets. I think there's an attribute on sx:head to enable this in Struts2.1 (parseContent=true or something like that)

Desbois Arnaud wrote:
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


------------------------------------------------------------------------

No virus found in this incoming message.
Checked by AVG Free Edition. Version: 7.5.516 / Virus Database: 269.19.15/1249 - Release Date: 29/01/2008 9:51 AM


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to