Evg*_*rov 1 java jsf richfaces
我尝试运行RichFaces4应用程序,但组件不呈现.例如,当我尝试这个演示:演示我得到这样的东西:
Here is an example of default tab panel with 3 tabs.
j_id1475365623_57f04a9f j_id1475365623_57f04a9f j_id1475365623_57f04a9f
j_id1475365623_57f04a75 j_id1475365623_57f04a75 j_id1475365623_57f04a75
j_id1475365623_57f04a6b j_id1475365623_57f04a6b j_id1475365623_57f04a6b
«
?
»
Here is tab #1
Here is an example of tab panel switched in "ajax" style. Second tab is disabled.
j_id1475365623_57f04a27 j_id1475365623_57f04a27 j_id1475365623_57f04a27
j_id1475365623_57f04a1d j_id1475365623_57f04a1d j_id1475365623_57f04a1d
j_id1475365623_57f04bf3 j_id1475365623_57f04bf3 j_id1475365623_57f04bf3
«
?
»
Here is tab #1
Here is an example of tab panel switched completely on client.
j_id1475365623_57f04bcf j_id1475365623_57f04bcf j_id1475365623_57f04bcf
j_id1475365623_57f04ba5 j_id1475365623_57f04ba5 j_id1475365623_57f04ba5
j_id1475365623_57f04b9b j_id1475365623_57f04b9b j_id1475365623_57f04b9b
«
?
»
Here is tab #1
Here is tab #2
Here is tab #3
Run Code Online (Sandbox Code Playgroud)
我的代码与演示中的代码几乎相同.我刚刚添加了表单标签,因为它抱怨它.
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:a4j="http://richfaces.org/a4j"
xmlns:rich="http://richfaces.org/rich">
<p>Here is an example of default tab panel with 3 tabs.</p>
<h:form>
<rich:tabPanel>
<rich:tab label="First">
Here is tab #1
</rich:tab>
<rich:tab label="Second">
Here is tab #2
</rich:tab>
<rich:tab label="Third">
Here is tab #3
</rich:tab>
</rich:tabPanel>
<br/><br/>
<p>Here is an example of tab panel switched in "ajax" style. Second tab is disabled.</p>
<rich:tabPanel switchType="ajax">
<rich:tab label="First">
Here is tab #1
</rich:tab>
<rich:tab label="Second" disabled="true">
Here is tab #2
</rich:tab>
<rich:tab label="Third">
Here is tab #3
</rich:tab>
</rich:tabPanel>
<br/><br/>
<p>Here is an example of tab panel switched completely on client.</p>
<rich:tabPanel switchType="client">
<rich:tab label="First">
Here is tab #1
</rich:tab>
<rich:tab label="Second">
Here is tab #2
</rich:tab>
<rich:tab label="Third">
Here is tab #3
</rich:tab>
</rich:tabPanel>
</h:form>
</ui:composition>
Run Code Online (Sandbox Code Playgroud)
这就是Crome开发者工具告诉我的内容http://img571.imageshack.us/i/rfnotdefined.jpg (未捕获的ReferenceError:RichFaces未定义)
这意味着生成的HTML中未提供RichFaces所需的JavaScript文件<head>.您需要确保在模板中使用JSF <h:head>组件而不是纯HTML <head>.这就是新的JSF 2.0资源注入机制的mandatroy,JSF和RichFaces将在那里注入与Ajax/UI相关的JavaScripts/Stylesheets.
但是我想知道服务器日志中是否记录了缺少的内容<h:head>.密切关注服务器日志.