Javascript <;o:commandScript>;:引用命名空间JS函数名
我使用omnifacesJavascript <;o:commandScript>;:引用命名空间JS函数名,javascript,jsf,omnifaces,Javascript,Jsf,Omnifaces,我使用omnifaces-tag在滚动条上加载数据。目前,该片段工作正常,但我想知道是否可以从外部js文件引用functionname,以避免在xhtml文件中定义所有这些脚本: products.xhtml: <o:commandScript name="loadNext" actionListener="#{productBean.loadNext}" render="products"/> <script type="text/javascript">
-tag
在滚动条上加载数据。目前,该片段工作正常,但我想知道是否可以从外部js文件引用functionname,以避免在xhtml文件中定义所有这些脚本:
products.xhtml:
<o:commandScript name="loadNext" actionListener="#{productBean.loadNext}" render="products"/>
<script type="text/javascript">
$('.scrollSpy').on('inview.uk.scrollspy', function() { //UIKit scrollspy listener
loadNext();
});
</script>
<h:panelGroup id="products">
<div class="box scrollSpy">
...
</div>
</h:panelGroup>
<o:commandScript name="GENERIC.loadNext"
actionListener="#{productBean.loadNext}"/>
但我明白了
[o:commandScript 'name' attribute 'GENERIC.loadNext' does not represent a valid script function name.]
而来自generic.js的常规调用工作正常,例如
提前感谢您的建议。这个要求从一开始就没有考虑过。根据,我已经为当前的2.3快照修复了它
<代码> <代码>考虑一个(正确放置)期无效,省略显式<代码> var >代码>声明。感觉真好。3..2..1:太好了,谢谢!不客气。以防万一,2.3-RC1刚刚发布。半小时内到马文。
[o:commandScript 'name' attribute 'GENERIC.loadNext' does not represent a valid script function name.]