[jboss-user] [JBoss Portal] - problems using dojo/dijit

amouradi do-not-reply at jboss.com
Sun Jul 20 19:01:05 EDT 2008


Hello,

I was wondering if anyone succeeded using dojo dijits in their portlets. I have tried using elements with defined dojoType, and they are not being rendered correctly, it seems dojo is not parsing dijits on the page.
If I add them programmatically, that sort of works, but then still not rendered correctly. I am using this code to include css and dojo.js.

<style type="text/css">
  |       @import "<%=request.getContextPath()%>/scripts/dojo/dojo/resources/dojo.css";
  |       @import "<%=request.getContextPath()%>/scripts/dojo/dijit/tests/css/dijitTests.css"; 
  |       @import "<%=request.getContextPath()%>/scripts/dojo/dijit/themes/tundra/tundra.css";
  |       .dj_ie INPUT#setvaluetest { font-family: Courier; }
  |   </style>
  | <div id="scripts_<portlet:namespace/>"> </div>
  |   
  |   <script type="text/javascript">
  |   
  |     function getJsFile_<portlet:namespace/>(jsFile) {
  |       return "<%=request.getContextPath()%>" + jsFile ;
  |     }
  |     //this creates separate namespace for dojo
  |     if (typeof dojo == "undefined") {
  |         /* Build script tag. */
  |         var script = document.createElement("script");
  |         script.src = getJsFile_<portlet:namespace/>("/scripts/dojo/dojo/dojo.js");
  |         script.type= "text/javascript";
  |         script.djConfig = "isDebug: true, parseOnLoad:true";
  |    
  |         /* Insert at the top of portlet scripts_<namespace>. */
  |         var scripts_<portlet:namespace/> = document.getElementById("scripts_<portlet:namespace/>");
  |         scripts_<portlet:namespace/>.insertBefore(script, scripts_<portlet:namespace/>.firstChild);
  |     }
  |   
  |   </script>
  | 
  | <script type="text/javascript">
  |     dojo.require("dojo.parser");
  |     dojo.require("dojo.date");
  |     dojo.require("dijit.form.FilteringSelect");
  |     dojo.require("dijit.form.Form");
  |     dojo.require("dojo.data.ItemFileReadStore");
  |     ..... etc 

Anyone had more luck than me? Please help, would really appreciate!

Thanks!
Ann
   


View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4165543#4165543

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4165543



More information about the jboss-user mailing list