openfaces 树表缺少 js
当尝试将 RichFaces 与 OpenFaces 合并到树表中时,它不显示任何展开折叠按钮。原来是部分js没有加载,可能是这个原因。
JSF 代码如下:
<o:treeTable var="o">
<o:dynamicTreeStructure nodeChildren="#{bean.originNodeChildren}"
nodeHasChildren="#{bean.originHasChildren()}"/>
<o:treeColumn expandedToggleImageUrl="/img/toggle-expand-light.png"
collapsedToggleImageUrl="img/toggle-collapse-light.png">
<h:outputText value="#{o.description}"/>
</o:treeColumn>
</o:treeTable>
Bean 代码被正确触发(包括 hasChildren 方法)。
JS 例外:
Failed to load resource: the server responded with a status of 404 (/openFacesResources/META-INF/resources/openfaces/util/ajaxUtil-2.1.EA1.1143.js)
Failed to load resource: the server responded with a status of 404 (/openFacesResources/META-INF/resources/openfaces/util/util-2.1.EA1.1143.js)
Failed to load resource: the server responded with a status of 404 (/openFacesResources/META-INF/resources/openfaces/tableUtil-2.1.EA1.1143.js)
Failed to load resource: the server responded with a status of 404 (/openFacesResources/META-INF/resources/openfaces/table/table-2.1.EA1.1143.js)
Failed to load resource: the server responded with a status of 404 (/openFacesResources/META-INF/resources/openfaces/table/treeTable-2.1.EA1.1143.js)
使用 OpenFaces 2.0 版和 RichFaces 3.3.3 版。
While trying to incorporate RichFaces with OpenFaces in a tree table, and it doesn't display any expand collapse buttons. It turned out that some of the js are not loaded, which might be the cause of it.
JSF code is as follows:
<o:treeTable var="o">
<o:dynamicTreeStructure nodeChildren="#{bean.originNodeChildren}"
nodeHasChildren="#{bean.originHasChildren()}"/>
<o:treeColumn expandedToggleImageUrl="/img/toggle-expand-light.png"
collapsedToggleImageUrl="img/toggle-collapse-light.png">
<h:outputText value="#{o.description}"/>
</o:treeColumn>
</o:treeTable>
Bean code is being triggered correctly (including hasChildren method).
JS exceptions:
Failed to load resource: the server responded with a status of 404 (/openFacesResources/META-INF/resources/openfaces/util/ajaxUtil-2.1.EA1.1143.js)
Failed to load resource: the server responded with a status of 404 (/openFacesResources/META-INF/resources/openfaces/util/util-2.1.EA1.1143.js)
Failed to load resource: the server responded with a status of 404 (/openFacesResources/META-INF/resources/openfaces/tableUtil-2.1.EA1.1143.js)
Failed to load resource: the server responded with a status of 404 (/openFacesResources/META-INF/resources/openfaces/table/table-2.1.EA1.1143.js)
Failed to load resource: the server responded with a status of 404 (/openFacesResources/META-INF/resources/openfaces/table/treeTable-2.1.EA1.1143.js)
Using OpenFaces version 2.0 and RichFaces version 3.3.3.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
需要在 web.xml 中为开放面配置资源过滤器,工作就完成了。像这样的东西:
It is needed to configure resource filter for open faces in web.xml and the job is done. Something like:
看来您确实没有在应用程序的 xml 文件中声明 OpenFaces 资源过滤器。以下是有关如何声明过滤器的文档摘录(请注意,您不必自己为此过滤器创建任何 Java 类):
请参阅 安装 部分,以及 OpenFaces 2.0 中的资源过滤器优化部分文档。
This looks like you have not declared the OpenFaces resource filter in the application's xml file indeed. Here's an excerpt from documentation on how a filter can be declared (note that you don't have to create any Java classes for this filter yourself):
See the Installation section, and the Resource Filter Optimization sections in OpenFaces 2.0 documentation.