从IBM的连接操场教程不是为我工作https://greenhouse.lotus.com/sbt/SBTPlayground.nsf/JavaScriptSnippets.xsp#snippet=Social_ActivityStreams_Controls_Simple_Stream_All_Extensions
这个工程
require(["sbt/dom", "sbt/config", "sbt/connections/controls/astream/ActivityStreamWrapper"], function(dom, config, ActivityStreamWrapper) {
var activityStreamWrapper = new ActivityStreamWrapper({
feedUrl: "/basic/rest/activitystreams/@public/@all/@all?rollup=true"
});
dom.byId("activityStreamDiv").appendChild(activityStreamWrapper.domNode);
activityStreamWrapper.startup();
});
添加至关重大的扩展属性在配置上,它停止工作,没有显示器,没有脚本错误可以从开发工具中可以看出,
require(["sbt/dom", "sbt/config", "sbt/connections/controls/astream/ActivityStreamWrapper"], function(dom, config, ActivityStreamWrapper) {
var activityStreamWrapper = new ActivityStreamWrapper({
feedUrl: "/basic/rest/activitystreams/@public/@all/@all?rollup=true",
extensions: {
refreshButton: true
}
});
dom.byId("activityStreamDiv").appendChild(activityStreamWrapper.domNode);
activityStreamWrapper.startup();
});
我使用的XPages来渲染活动流,所使用的组件以使所有的JS和CSS文件被命名为XE:sbtClient,XPages中使用道场1.8.6渲染SBT js文件是道场1.4.3。 不知道如果是这样的问题。 这里是我的applicatoin完整soucre代码。
<?xml version="1.0" encoding="UTF-8"?>
<xp:view xmlns:xp="http://www.ibm.com/xsp/core"
xmlns:xe="http://www.ibm.com/xsp/coreex" dojoParseOnLoad="true"
xmlns:xc="http://www.ibm.com/xsp/custom">
<xe:sbtClient id="sbtClient1" loadDojo="true" loadCSS="true">
</xe:sbtClient>
<div id="activityStreamDiv" style="height:100%;"></div>
<xp:scriptBlock id="scriptBlock1">
<xp:this.value><![CDATA[
require(["sbt/dom", "sbt/config", "sbt/connections/controls/astream /ActivityStreamWrapper"], function(dom, config, ActivityStreamWrapper) {
var activityStreamWrapper = new ActivityStreamWrapper({
feedUrl: "/basic/rest/activitystreams/@public/@all/@all?rollup=true",
extensions: {
refreshButton: true
}
});
dom.byId("activityStreamDiv").appendChild(activityStreamWrapper.domNode);
activityStreamWrapper.startup();
});]]></xp:this.value>
</xp:scriptBlock>
</xp:view>