We have Esri maps embedded in our XPages apps, and the Esri javascript api needs to load its own version of dojo (1.8.3 currently). With the new version of xpages and the updated loader in dojo 1.8, we are unable to map the dojo namespace to allow both the xpages and the esri versions of dojo to coexist. The page throws a ‘defineAlreadyDefined’ error. The code looks something like this:
<xp:view xmlns:xp=“http://www.ibm.com/xsp/core”>
xp:this.resources
<xp:styleSheet
href=“http://serverapi.arcgisonline.com/jsapi/arcgis/3.5/js/dojo/dijit/themes/claro/claro.css”>
</xp:styleSheet>
<xp:styleSheet
href=“http://serverapi.arcgisonline.com/jsapi/arcgis/3.5/js/esri/css/esri.css”>
</xp:styleSheet>
<xp:script clientSide=“true”>
// dojo.registerModulePath(“esri”,“http://serverapi.arcgisonline.com/jsapi/arcgis/3.5/js/esri”);
dojoConfig = {
baseUrl: “http://serverapi.arcgisonline.com/jsapi/arcgis/3.5”,
packages: [
{
name: ‘esriDojo’,
location: ‘/js/dojo’,
main: ‘base’,
packageMap: {
dojo: ‘esriDojo’
}
}
]
};
</xp:script>
<xp:script
src=“http://serverapi.arcgisonline.com/jsapi/arcgis/3.5/”
clientSide=“true”>
</xp:script>
<xp:dojoModule name=“esri.map”></xp:dojoModule>
</xp:this.resources>
<xp:eventHandler event=“onClientLoad” submit=“false”>
xp:this.script<![CDATA[var map;
function init(){
var map = new esri.Map(“mapDiv”, {
center: [-56.049, 38.485],
zoom: 3,
basemap: “streets”
});
}
dojo.ready(init);
]]></xp:this.script>
</xp:eventHandler>
</xp:view>
Help or thoughts would be appreciated!