我正在尝试在ICN中呈现保存的搜索(搜索模板),下面是代码/用于调用服务插件的通用类/
ecm.model.desktop
.getRepository(Desktop.defaultRepositoryId).retrieveSearchTemplate("{40B98008-EBB2-420A-8163-C74699EB678D}",null,null,function(searchTeamplate){
debugger;
console.log("searchTeamplate" +searchTeamplate);
this.chkSearchTabContainer = dijit.byId("chkSearchTabContainer");
if(!this.chkSearchTabContainer){
this.chkSearchTabContainer = new SearchTabContainer({
},dojo.byId(domConstruct.create("div", {
id : "checkSearchDIV"
}, dojo.byId("myProgStackContainer"))))
}
this.chkSearchTabContainer.openTab({
tabType : "search",
repository : ecm.model.desktop.getRepository(Desktop.defaultRepositoryId),
openNewTab : true,
selected : true,
closable : true,
name:"try",
// version: version,
"searchTemplate" : searchTeamplate,
});
this.chkSearchTabContainer.startup();
this.chkSearchTabContainer.show();
});
console.log 正在打印搜索Teamplateecm.model.SearchTemplate[StoredSearch,{83443B0F-496B-46B0-B43C-5A23E494688D},{40B98008-EBB2-420A-8163-C74699EB678D}]
但什么都没有渲染。相反,我不断收到错误消息,因为类型错误: 名称未定义。下面是错误堆栈跟踪
cache["dojo/_base/loader"]/</slashName
.cache["dojo/_base/loader"]/</dojo.require
.cache["ecm/widget/layout/_TabContainerBase"]/</<._openTab
.cache["ecm/widget/layout/_TabContainerBase"]/</<.openTab
inherited
.cache["ecm/widget/search/SearchTabContainer"]/</<.openTab
.init/<
.cache["ecm/model/Repository"]/</<._retrieveSearchTemplateCompleted
.cache["ecm/model/Repository"]/</<.retrieveSearchTemplate/request<
.cache["dojo/_base/lang"]/</lang.hitch/<
.cache["ecm/model/Request"]/</Request<._onFinished
.cache["ecm/model/Request"]/</Request<.send/this.xmlHttpRequest.onreadystatechange<
.cache["dojo/_base/lang"]/</lang.hitch/<
好的,
这就是我所做的
创建了一个搜索选项卡
this.chkSearchTabContainer = new SearchTab(
{
id : "chkSearchTabContainer",
tabStrip : false,
useMenu : false,
useSlider : false,
style : "height:800px"
});
获取搜索模板并设置
this.defaultRepository.retrieveSearchTemplates(
function(searchTeamplateItems) {
for (var k = 0; k < searchTeamplateItems.length; k++) {
if (searchTeamplateItems[k].name =="my search template name") {
dijit.byId("chkSearchTabContainer").setSearchTemplate(searchTeamplateItems[k],false);
dijit.byId("checkContentPane").set("content",dijit.byId("chkSearchTabContainer"));
dijit.byId("checkContentPane").resize();
dijit.byId("dashBoardTC").startup();
}
}
}, null);