在新的 Sharepoint 2013 中使用旧的 Dojo 0.9
Using old Dojo 0.9 in new Sharepoint 2013
我有一个使用旧 Dojo Framework 0.9 的 Web 应用程序。
迁移到新的 Dojo 会非常耗时。
在一个简单的 iFrame 中,我的 Web 应用程序是 运行。
但是当我在 Sharepoint2013 Webpart 中启动它时,dojo 似乎 "initialize" 不正确。
在 main.aspx 中,我使用一些 div-Container 作为 Main-Window、Pop-Up 等的节点。
当应该显示登录弹出窗口时,使用 Manager.js
在 PopupContainer.js 中找不到节点
是否存在跨域问题或是否必须配置 Sharepoint2013...
提前致谢。
代码片段:
main.aspx
<script type="text/javascript" language="javascript" src="js/dojo.js"></script>
<script language="javascript" type="text/javascript">
...
dojo.require("dojo.widget.ContentPane");
dojo.require("dojo.widget.SplitContainer")
dojo.require("dojo.widget.LayoutContainer");
dojo.require("dojo.widget.HtmlWidget");
dojo.require("dojo.widget.Dialog");
dojo.require("dojo.widget.Menu2");
dojo.require("dojo.widget.Tooltip");
dojo.require("dojo.widget.Button");
dojo.require("dojo.widget.FloatingPane");
dojo.require("dojo.widget.CWComboBox");
dojo.require("dojo.widget.ComboBox");
dojo.require("dojo.widget.PopupContainer");
...
dojo.hostenv.writeIncludes();
...
<body id="content">
<% Process(); %>
<div dojoType="ContentPane" visible=false isLoaded=true dojoAttachPoint='containerNode' widgetId="MenuPane" label="Empty" style="width:0px; height:0px; overflow:hidden;" executeScripts=true cacheContent=false>
</div>
<!-- Dummy Pane for popup containers -->
<div dojoType="ContentPane" visible=false isLoaded=true dojoAttachPoint='containerNode' widgetId="PopupContainerPane" label="Empty" style="width:300px; height:300px; overflow:hidden;" executeScripts=true cacheContent=false>
</div>
<!-- Dummy Pane for Dynamic Dialogs -->
<div dojoType="ContentPane" visible=false isLoaded=true dojoAttachPoint='containerNode' widgetId="DialogPane" label="Empty" style="width:0px; height:0px; overflow:hidden;" executeScripts=true cacheContent=false>
</div>
<!-- MainPane -->
<div dojoType="CWContentPane" isLoaded=true id="w_1" widgetId="w_1" label="Empty" style="width:100%; height:100%; overflow:hidden;" executeScripts=true cacheContent=false adjustPaths=false parseContent=true scriptSeparation=false>
</div>
</body>
...
Dialog.js
...
cDialogPane 仍未定义,因为在 Manager.js
中找不到小部件 _strDialogPane
var cDialogPane = dojo.widget.manager.getWidgetById(_strDialogPane);
if (null == cDialogPane) {
alert('dojo.dialog.loadDialog: null == DialogPane');
window.location.replace(dojo.session.getErrorPage());
}
Manager.js
id 未定义,因为widgetIds-Array 为空,但至少应该填充main.aspx[=13 中定义的divs =]
...
this.getWidgetById = function(id){
if(dojo.lang.isString(id)){
return this.widgetIds[id];
}
return id;
}
...
我们没有解决方案,但我们现在正在使用现代版本的 Dojo。
可能这是我们在 Dojo 0.9 中遇到的一种 CORS 问题。
这个版本创建时,IE8 是最先进的,现在网络安全已经发展,但 Dojo 0.9 不是。 :-)
我有一个使用旧 Dojo Framework 0.9 的 Web 应用程序。 迁移到新的 Dojo 会非常耗时。
在一个简单的 iFrame 中,我的 Web 应用程序是 运行。 但是当我在 Sharepoint2013 Webpart 中启动它时,dojo 似乎 "initialize" 不正确。
在 main.aspx 中,我使用一些 div-Container 作为 Main-Window、Pop-Up 等的节点。 当应该显示登录弹出窗口时,使用 Manager.js
在 PopupContainer.js 中找不到节点是否存在跨域问题或是否必须配置 Sharepoint2013...
提前致谢。
代码片段:
main.aspx
<script type="text/javascript" language="javascript" src="js/dojo.js"></script>
<script language="javascript" type="text/javascript">
...
dojo.require("dojo.widget.ContentPane");
dojo.require("dojo.widget.SplitContainer")
dojo.require("dojo.widget.LayoutContainer");
dojo.require("dojo.widget.HtmlWidget");
dojo.require("dojo.widget.Dialog");
dojo.require("dojo.widget.Menu2");
dojo.require("dojo.widget.Tooltip");
dojo.require("dojo.widget.Button");
dojo.require("dojo.widget.FloatingPane");
dojo.require("dojo.widget.CWComboBox");
dojo.require("dojo.widget.ComboBox");
dojo.require("dojo.widget.PopupContainer");
...
dojo.hostenv.writeIncludes();
...
<body id="content">
<% Process(); %>
<div dojoType="ContentPane" visible=false isLoaded=true dojoAttachPoint='containerNode' widgetId="MenuPane" label="Empty" style="width:0px; height:0px; overflow:hidden;" executeScripts=true cacheContent=false>
</div>
<!-- Dummy Pane for popup containers -->
<div dojoType="ContentPane" visible=false isLoaded=true dojoAttachPoint='containerNode' widgetId="PopupContainerPane" label="Empty" style="width:300px; height:300px; overflow:hidden;" executeScripts=true cacheContent=false>
</div>
<!-- Dummy Pane for Dynamic Dialogs -->
<div dojoType="ContentPane" visible=false isLoaded=true dojoAttachPoint='containerNode' widgetId="DialogPane" label="Empty" style="width:0px; height:0px; overflow:hidden;" executeScripts=true cacheContent=false>
</div>
<!-- MainPane -->
<div dojoType="CWContentPane" isLoaded=true id="w_1" widgetId="w_1" label="Empty" style="width:100%; height:100%; overflow:hidden;" executeScripts=true cacheContent=false adjustPaths=false parseContent=true scriptSeparation=false>
</div>
</body>
...
Dialog.js
...
cDialogPane 仍未定义,因为在 Manager.js
var cDialogPane = dojo.widget.manager.getWidgetById(_strDialogPane);
if (null == cDialogPane) {
alert('dojo.dialog.loadDialog: null == DialogPane');
window.location.replace(dojo.session.getErrorPage());
}
Manager.js
id 未定义,因为widgetIds-Array 为空,但至少应该填充main.aspx[=13 中定义的divs =]
...
this.getWidgetById = function(id){
if(dojo.lang.isString(id)){
return this.widgetIds[id];
}
return id;
}
...
我们没有解决方案,但我们现在正在使用现代版本的 Dojo。 可能这是我们在 Dojo 0.9 中遇到的一种 CORS 问题。 这个版本创建时,IE8 是最先进的,现在网络安全已经发展,但 Dojo 0.9 不是。 :-)