Xpages 使引导开关自定义控件正常工作
[更新-已解决]Xpages 使引导开关自定义控件正常工作,xpages,Xpages,[更新-已解决] <xp:this.resources> <xp:styleSheet href="/bootstrap-switch/css/bootstrap-switch.min.css"></xp:styleSheet> </xp:this.resources> 这不是AMD的问题。问题是我使用的引导开关代码版本不正确。我切换到3.3.4,一切正常。谢谢你,霍华德 <xp:this.resources
<xp:this.resources>
<xp:styleSheet
href="/bootstrap-switch/css/bootstrap-switch.min.css"></xp:styleSheet>
</xp:this.resources>
这不是AMD的问题。问题是我使用的引导开关代码版本不正确。我切换到3.3.4,一切正常。谢谢你,霍华德
<xp:this.resources>
<xp:styleSheet
href="/bootstrap-switch/css/bootstrap-switch.min.css"></xp:styleSheet>
</xp:this.resources>
[更新-我添加了我用来解决AMD问题的代码]
<xp:this.resources>
<xp:styleSheet
href="/bootstrap-switch/css/bootstrap-switch.min.css"></xp:styleSheet>
</xp:this.resources>
请参阅本帖末尾
<xp:this.resources>
<xp:styleSheet
href="/bootstrap-switch/css/bootstrap-switch.min.css"></xp:styleSheet>
</xp:this.resources>
我正在努力工作
<xp:this.resources>
<xp:styleSheet
href="/bootstrap-switch/css/bootstrap-switch.min.css"></xp:styleSheet>
</xp:this.resources>
我相信我完全按照指示做了。我遇到的唯一问题是,在他的自定义控件属性中没有switchBinding,我认为这是必要的,所以我添加了一个
<xp:this.resources>
<xp:styleSheet
href="/bootstrap-switch/css/bootstrap-switch.min.css"></xp:styleSheet>
</xp:this.resources>
我没有发现任何错误,但我看到的只是一个空白页,上面有计算字段[Bryan]
<xp:this.resources>
<xp:styleSheet
href="/bootstrap-switch/css/bootstrap-switch.min.css"></xp:styleSheet>
</xp:this.resources>
我做错了什么
<xp:this.resources>
<xp:styleSheet
href="/bootstrap-switch/css/bootstrap-switch.min.css"></xp:styleSheet>
</xp:this.resources>
Xpage
<xp:this.resources>
<xp:styleSheet
href="/bootstrap-switch/css/bootstrap-switch.min.css"></xp:styleSheet>
</xp:this.resources>
自定义控件
<xp:this.resources>
<xp:styleSheet
href="/bootstrap-switch/css/bootstrap-switch.min.css"></xp:styleSheet>
</xp:this.resources>
自定义控件属性
<xp:this.resources>
<xp:styleSheet
href="/bootstrap-switch/css/bootstrap-switch.min.css"></xp:styleSheet>
</xp:this.resources>
http://www.ibm.com/xsp/custom
xc
cc_CommonFieldCheckBox3
cc_CommonFieldCheckBox3
/cc_CommonFieldCheckBox3.xsp
符合事实的
xml版本=1.0编码=UTF-8?&xd;
xp:查看&xd;
xmlns:xp=http://www.ibm.com/xsp/core&xd;
BBootstrap开关自定义控件/B/xp:视图
自定义控件-字段
刷新ID
一串
刷新ID
如果提供控件Id,则该控件将在更改时部分刷新。如果为空,则不会发生刷新。
错误的
校验值
一串
校验值
符合事实的
未选中的值
一串
未选中的值
符合事实的
在线标签
一串
在线标签
符合事实的
在…上
标签外
一串
标签外
符合事实的
关
标签文本
一串
标签文本
符合事实的
标签
数据大小
一串
数据大小
com.ibm.workplace.designer.property.editors.comboParameterEditor
迷你&xd;
小型&xd;
正常&xd;
大的
典型的
开关的大小
颜色
一串
颜色
com.ibm.workplace.designer.property.editors.comboParameterEditor
初级&xd;
信息&xd;
成功&xd;
警告&xd;
危险&xd;
违约
主要的,重要的
开关左侧的颜色
色差
一串
色差
com.ibm.workplace.designer.property.editors.comboParameterEditor
初级&xd;
信息&xd;
成功&xd;
警告&xd;
危险&xd;
违约
违约
开关右侧的颜色
唇宽
一串
唇宽
汽车
中心控制柄的宽度(以像素为单位),默认值为“自动”
把手宽度
一串
把手宽度
汽车
左右两侧的宽度(以像素为单位),默认为“自动”
相反的
一串
相反的
反向开关方向
错误的
com.ibm.workplace.designer.property.editors.comboParameterEditor
真&xd;
错误的
开关绑定
一串
<xp:this.resources>
<xp:styleSheet
href="/bootstrap-switch/css/bootstrap-switch.min.css"></xp:styleSheet>
</xp:this.resources>
OpenNTF代码段中的属性似乎缺少一个名为switchBinding的属性—它是一个字符串。确保将其添加到自定义控件属性定义中
<xp:this.resources>
<xp:styleSheet
href="/bootstrap-switch/css/bootstrap-switch.min.css"></xp:styleSheet>
</xp:this.resources>
<property>
<property-name>switchBinding</property-name>
<property-class>string</property-class>
<display-name>switchBinding</display-name>
</property>
如果未包含此项,则在Designer中会出现错误
<xp:this.resources>
<xp:styleSheet
href="/bootstrap-switch/css/bootstrap-switch.min.css"></xp:styleSheet>
</xp:this.resources>
另外,一定要检查您的浏览器控制台,看看是否有任何错误被抛出,就像它找不到css或js文件一样
<xp:this.resources>
<xp:styleSheet
href="/bootstrap-switch/css/bootstrap-switch.min.css"></xp:styleSheet>
</xp:this.resources>
请注意,上面提到的AMD问题并不是一个与此相关的因素
<xp:this.resources>
<xp:styleSheet
href="/bootstrap-switch/css/bootstrap-switch.min.css"></xp:styleSheet>
</xp:this.resources>
如果您还有问题,请告诉我。如果需要,我可以将整个工作数据库发送给您
<xp:this.resources>
<xp:styleSheet
href="/bootstrap-switch/css/bootstrap-switch.min.css"></xp:styleSheet>
</xp:this.resources>
Howard我认为这是AMD加载程序的问题,因为Bootstrap Switch使用AMDPer,我从这个片段中添加了代码,并添加到正在使用的js库中,没有任何更改。我将把代码发布到我的原始问题。尝试简单的方法,编辑引导开关库并用false替换AMD部件。我已更新OpenNTF代码段以添加缺少的属性。我再次尝试,修复了您提到的问题,但我看到的只是一个裸按钮。如果你不介意的话,我希望你能给我一份DB。
<xp:this.resources>
<xp:styleSheet
href="/bootstrap-switch/css/bootstrap-switch.min.css"></xp:styleSheet>
</xp:this.resources>