引用错误:未定义模板



我正在开发一个ICN(3.0.4)插件,其中我创建了一个名为"SampleAction"的插件操作。单击此按钮后,我想打开一个对话框并显示一些选项供用户选择。从服务 js 中,我正在调用另一个模板化小部件,在其中创建对话框。调用此小部件时,我收到错误为"引用错误:未定义模板"。下面是模板化小部件的代码片段

*************.JS****************

define([
"dojo",
"dijit",
"dojo/_base/declare",
"dojo/_base/lang",
"dijit/form/FilteringSelect",
"dijit/form/Button",
"dojo/store/Memory",
"dojo/query",
"dojo/on",
"dojo/aspect",
"dojo/dom-construct",
"dojo/dom",
"dijit/registry",
"dojo/dom-attr",
"ecm/model/Request",
"ecm/model/Desktop",
"dojo/ready",
"dojo/NodeList-traverse",
"dijit/ConfirmDialog",
"dijit/_TemplatedMixin",
"dijit/_WidgetsInTemplateMixin",
"dojo/text!./templates/SendDocsToCustomerScreen.html"
],
function(dojo, dijit, declare, lang, FilteringSelect, Button, Memory, query, on, aspect, domConstruct, dom, registry, attr, Request, Desktop, ready,test,ConfirmDialog,
_TemplatedMixin,_WidgetsInTemplateMixin,template) {
return declare("iCNCommonServiceDojo.SendDocsToCustomerImpl", [ _TemplatedMixin, _WidgetsInTemplateMixin], {
**contentString: template,**
widgetsInTemplate: true,
showDialogBox: function(repository, items, callback, teamspace, resultSet, parameterMap){
var confirmDialog = new ConfirmDialog({
title: "Send Documents to Customer",
content: "Test content.",
style: "width: 40%;height:100%;",
buttonOk:"Send",
buttonCancel:"Cancel"
},"sendDocsToCustomerDialog");
confirmDialog.set('content',this.dialogContent);
confirmDialog.refresh();
confirmDialog.show();
} 
});
});

***************.HTML*********************

<div id="sendDocsToCustomer">
<div id="sendDocsToCustomerDialog"></div>
<div data-dojo-type="dojox.layout.TableContainer"
data-dojo-attach-point="**dialogContent**">
<div data-dojo-type="ecm.widget.RadioButton" data-dojo-attach-point="email" data-dojo-props="lable:'Email'"></div>
<div data-dojo-type="ecm.widget.RadioButton" data-dojo-attach-point="fax" data-dojo-props="lable:'Fax'"></div>
</div>
</div>
</div>

当我调试并查找值时

contentString: template

我看到错误消息。加载插件时,我在控制台中看不到任何错误。

您使用的是 contentString 而不是 templateString;ContentString(如果我没记错的话)用于填充对话框。

所以

templateString: template,

另参考: https://dojotoolkit.org/reference-guide/1.10/dijit/_TemplatedMixin.html

相关内容

  • 没有找到相关文章

最新更新