1

I try to run RichFaces4 app but the components don't render. For example when I try this demo: Demo I get something like this:

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

My code is almost the same as in the demo. I just added form tag becouse it complained for it.

<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>
Evgeni Dimitrov
  • 21,976
  • 33
  • 120
  • 145
  • Try again.... There is no way we can help you with what you just posted. Try posting some of the source you used. – Nix Apr 22 '11 at 18:07
  • Rightclick page in browser, view source, does it look right? (i.e. no single line of unparsed JSF code). – BalusC Apr 22 '11 at 18:31
  • It doesn't look good. This part is a little bit suspicious for me :"Here is tab #1 – Evgeni Dimitrov Apr 22 '11 at 18:55
  • That part is fine. It's the generated HTML/JS code. Do you have Firebug? Didn't it tell anything about errors in downloaded resources? E.g. missing JavaScript files and on. – BalusC Apr 22 '11 at 19:48
  • That's what Crome Developer Tools told me http://img571.imageshack.us/i/rfnotdefined.jpg/ (Uncaught ReferenceError: RichFaces is not defined) I use RF 4, JSF 2.0, eclipse, Tomcat7, if that will help. – Evgeni Dimitrov Apr 22 '11 at 20:05

2 Answers2

6

That's what Crome Developer Tools told me http://img571.imageshack.us/i/rfnotdefined.jpg (Uncaught ReferenceError: RichFaces is not defined)

This means that the necessary JavaScript files of RichFaces are not been supplied in the generated HTML <head>. You need to ensure that you're using the JSF <h:head> component instead of plain HTML <head> in the template. This is namely mandatroy for the new JSF 2.0 resource injection mechanism, JSF and RichFaces will inject Ajax/UI-related JavaScripts/Stylesheets in there.

I however wonder if anything has been logged in the server log about the lack of the <h:head>. Keep an eye on the server logs.

BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
0

At least in some cases nothing is being logged to the server log about the lack of <h:head>. Using just <head> in the facelets template with MyFaces 2.1.4, RichFaces 4.0.0 on WAS 7.0.0.13 results in the RichFaces components not rendering properly, but the a4j components working fine. Definitely something to be on the lookout for when migrating JSF1 projects.