SBT JavaScript库 [英] SBT javascript library

查看:124
本文介绍了SBT JavaScript库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

IBM Connections Playground的教程对我不起作用 https://greenhouse.lotus.com/sbt/SBTPlayground.nsf/JavaScriptSnippets.xsp#snippet=Social_ActivityStreams_Controls_Simple_Stream_All_Extensions

the tutorial from IBM connections playground is not working for me 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();
});

在配置中添加扩展属性后,它将停止工作,无法显示任何内容,并且无法从开发者工具中看到脚本错误,

efter adding the extension property in configuration, it stops working, nothing displays and no script error can be seen from developer tool,

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使用的是dojo 1.8.6,渲染的sbt js文件是dojo 1.4.3.不知道这是否是问题.这是我的应用程序中完整的源代码.

I am using Xpages to render the activity stream, the component in use to render all the JS and CSS files is named xe:sbtClient, xpages is using dojo 1.8.6, the rendered sbt js file is dojo 1.4.3. don't know if that is the problem. Here is the complete soucre code in my applicatoin.

<?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>

推荐答案

因此,两者之间的唯一区别是extensions属性?该工具包的较旧版本中的扩展存在问题,我认为将其更新为最新版本将解决您的问题.

So the only difference between the two is the extensions property? There was an issue with extensions in an older version of the toolkit, I think updating to the latest version will solve your issue.

如果您已经拥有最新版本,则需要有关此问题的更多信息.我已经尝试了您在操场上提出的建议,并且可以在其中使用(在JavaScript库下拉列表中选择dojo1.8.6)

If you have the latest version already then I'll need more information on this problem. I have tried what you suggested in the playground and it works there (select dojo1.8.6 in the JavaScript libraries dropdown)

这篇关于SBT JavaScript库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆