We can add the dojo widget programmtically in the Javascript section. Like this:
<mce:script type="text/javascript"><!-- var datepicker = dojo.widget.createWidget( "struts:StrutsDatePicker",{ id: "effectiveDate",name:"location.effectiveDate",saveFormat:"rfc" } ); function addPicker(){ var picker = dojo.byId("effectiveDate"); picker.appendChild(datepicker.domNode); } // --></mce:script>
or
var srcNode = document.createElement("div"); srcNode.innerHTML="This is my content"; var btn = dojo.widget.createWidget("Dialog",{},srcNode);
Reference article: