4 Replies Latest reply on Feb 24, 2009 3:45 AM by Luke Twardowsky

    Problem with rendering richfaces elements

    Luke Twardowsky Newbie

      I'm creating web application with facelets 1.1.15, richfaces 3.3.0 and Spring Web Flow 2.0.5 on jboss 5.0. On my page(below) richfaces elements(such as panel,dropdownMenu) aren't displayed and I have no idea why.

      <html 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:rich="http://richfaces.org/rich"
       xmlns:a4j="http://richfaces.org/a4j"
       xmlns:sf="http://www.springframework.org/tags/faces">
      
      <ui:composition template="/WEB-INF/layouts/layout.xhtml">
       <ui:define name="menu">
       <h:form id="menuForm">
       <rich:toolBar>
       <rich:dropDownMenu>
       <f:facet name="label">
       <h:outputText value="#{msg.admin}" />
       </f:facet>
       <rich:menuItem value="#{msg.chngOwn}" action="Change"/>
       </rich:dropDownMenu>
       </rich:toolBar>
       </h:form>
       </ui:define>
       <ui:define name="content">
       <h:form id="loginForm">
       <rich:panel>
       <div>
       <h:outputText value="#{msg.user}"/><h:inputText id="user" value="#{login.user}"/>
       <h:outputText value="#{msg.pass}"/><h:inputText id="password" value="#{login.password}"/>
       </div>
       <div>
       <h:commandButton value="#{msg.login}" action="login"/>
       </div>
       </rich:panel>
       </h:form>
       </ui:define>
       </ui:composition>
      </html>
      
      


      Thanks for all responses.

        • 1. Re: Problem with rendering richfaces elements
          Nick Belaevski Master

          Hello,

          Please check generated HTML, is it a real HTML or just Facelets page?

          • 2. Re: Problem with rendering richfaces elements
            Luke Twardowsky Newbie

            I'm not sure what you ask me, but below is source page:

            <?xml version="1.0" encoding="UTF-8"?>
            <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" >
            <html xmlns="http://www.w3.org/1999/xhtml">
            
            <head>
             <meta http-equiv="Content-Style-Type" content="text/css" />
             <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
             <link rel="stylesheet" href="../style/style.css" type="text/css" />
            </head>
            <body>
             <div class="title"><img src="../images/ozi2logo.jpg" alt="OZI 2" /></div>
             <div>
            
            <form id="menuForm" name="menuForm" method="post" action="/Projekt/s/login?execution=e1s1" enctype="application/x-www-form-urlencoded">
            <input type="hidden" name="menuForm" value="menuForm" />
            <table border="0" cellpadding="0" cellspacing="0" class="dr-toolbar-ext rich-toolbar " id="menuForm:menuBar" width="100%"><tr valign="middle"><td class="dr-toolbar-int rich-toolbar-item "><div class="dr-menu-label dr-menu-label-unselect rich-ddmenu-label rich-ddmenu-label-unselect " id="menuForm:j_id4"><div class="dr-label-text-decor rich-label-text-decor">Admin</div><div style="margin: 0px; padding: 0px; border: 0px; position: absolute; z-index: 100;"><div id="menuForm:j_id4_menu" class="dr-menu-list-border rich-menu-list-border" style="display: none; z-index: 2;"><div class="dr-menu-list-bg rich-menu-list-bg"><div class="dr-menu-item dr-menu-item-enabled rich-menu-item rich-menu-item-enabled " id="menuForm:j_id6" onclick="this.className='dr-menu-item dr-menu-item-enabled rich-menu-item rich-menu-item-enabled '; {var form = A4J.findForm(this);var params = new Object();params['menuForm:j_id6:hidden'] = 'menuForm:j_id6';Richfaces.jsFormSubmit('menuForm:j_id6',form.id,'',params);}; return false;;" onmousedown="Event.stop(event); " onmouseout="if (RichFaces.Menu.isWithin(event, this)) return; this.className='dr-menu-item dr-menu-item-enabled rich-menu-item rich-menu-item-enabled '; $('menuForm:j_id6').style.cssText=';'; $('menuForm:j_id6:icon').className='dr-menu-icon rich-menu-item-icon '; Element.removeClassName($('menuForm:j_id6:anchor'), 'rich-menu-item-label-selected');" onmouseover="if (RichFaces.Menu.isWithin(event, this)) return; this.className='dr-menu-item dr-menu-item-hover rich-menu-item rich-menu-item-hover ';; $('menuForm:j_id6').style.cssText='; ; ;'; $('menuForm:j_id6:icon').className='dr-menu-icon dr-menu-icon-selected rich-menu-item-icon rich-menu-item-icon-selected '; Element.addClassName($('menuForm:j_id6:anchor'), 'rich-menu-item-label-selected');" onmouseup="Event.stop(event); " style="; "><span class="dr-menu-icon rich-menu-item-icon " id="menuForm:j_id6:icon"><img alt="" height="16" src="/Projekt/a4j/g/3_3_0.GAimages/spacer.gif.faces" width="16" /></span><span class="rich-menu-item-label " id="menuForm:j_id6:anchor">Change Password</span></div><div class="dr-menu-list-strut rich-menu-list-strut"><div class="dr-menu-list-strut rich-menu-list-strut" width="1" height="1" style="">&#160;</div></div></div></div><script id="menuForm:j_id4_menu_script" type="text/javascript">new RichFaces.Menu.Layer('menuForm:j_id4_menu',50,800).asDropDown('menuForm:j_id4','menuForm:j_id4_span','onmouseover','onmouseout',{'onitemselect':function(event){;return true;},'oncollapse':function(event){;return true;},'horizontalOffset':0,'verticalOffset':0,'direction':'auto','onexpand':function(event){;return true;},'ongroupactivate':function(event){;return true;},'disabled':false,'jointPoint':'auto'} ).addItem('menuForm:j_id6',{'selectStyle':'','flagGroup':0,'selectClass':'','iconClass':'','closeOnClick':1,'disabled':false} );</script></div></div></td><td style="width:100%"></td></tr></table>
            </form></div>
             <div class="contentDiv">
            <form id="loginForm" name="loginForm" method="post" action="/Projekt/s/login?execution=e1s1" enctype="application/x-www-form-urlencoded">
            <input type="hidden" name="loginForm" value="loginForm" />
            <div class="dr-pnl rich-panel " id="loginForm:loginPanel"><div class="dr-pnl-b rich-panel-body " id="loginForm:loginPanel_body">
             <div>User<input id="loginForm:user" type="text" name="loginForm:user" />Password<input id="loginForm:password" type="text" name="loginForm:password" />
             </div>
            
             <div><input type="submit" name="loginForm:j_id12" value="Login" />
             </div></div></div>
            </form></div>
             <div></div>
            </body>
            </html>


            So as we can see there are richFaces elements but comparing to another page misses in :
            <link class="component" href="/Ozi2Web/a4j/s/3_3_0.GAorg/richfaces/renderkit/html/css/basic_classes.xcss/DATB/eAF7sqpgb-jyGdIAFrMEaw__.jsf;jsessionid=G8NWJjZcPN9zbp1p0SWlmW72vyVyW0Wq1Y5MQtP70LP2qnD7Tndg!-1314731741" rel="stylesheet" type="text/css" /><link class="component" href="/Ozi2Web/a4j/s/3_3_0.GAorg/richfaces/renderkit/html/css/extended_classes.xcss/DATB/eAF7sqpgb-jyGdIAFrMEaw__.jsf;jsessionid=G8NWJjZcPN9zbp1p0SWlmW72vyVyW0Wq1Y5MQtP70LP2qnD7Tndg!-1314731741" media="rich-extended-skinning" rel="stylesheet" type="text/css" /><script src="/Ozi2Web/a4j/g/3_3_0.GAorg.ajax4jsf.javascript.AjaxScript.jsf" type="text/javascript"></script><script src="/Ozi2Web/a4j/g/3_3_0.GAorg.ajax4jsf.javascript.PrototypeScript.jsf" type="text/javascript"></script><script src="/Ozi2Web/a4j/g/3_3_0.GAorg/richfaces/renderkit/html/scripts/utils.js.jsf" type="text/javascript"></script><script src="/Ozi2Web/a4j/g/3_3_0.GAorg/richfaces/renderkit/html/scripts/browser_info.js.jsf" type="text/javascript"></script><script src="/Ozi2Web/a4j/g/3_3_0.GAorg/richfaces/renderkit/html/scripts/modalPanel.js.jsf" type="text/javascript"></script><script src="/Ozi2Web/a4j/g/3_3_0.GAorg/richfaces/renderkit/html/scripts/modalPanelBorders.js.jsf" type="text/javascript"></script><link class="component" href="/Ozi2Web/a4j/s/3_3_0.GAorg/richfaces/renderkit/html/css/modalPanel.xcss/DATB/eAF7sqpgb-jyGdIAFrMEaw__.jsf;jsessionid=G8NWJjZcPN9zbp1p0SWlmW72vyVyW0Wq1Y5MQtP70LP2qnD7Tndg!-1314731741" rel="stylesheet" type="text/css" /><link class="component" href="/Ozi2Web/a4j/s/3_3_0.GAcss/panel.xcss/DATB/eAF7sqpgb-jyGdIAFrMEaw__.jsf;jsessionid=G8NWJjZcPN9zbp1p0SWlmW72vyVyW0Wq1Y5MQtP70LP2qnD7Tndg!-1314731741" rel="stylesheet" type="text/css" /><script type="text/javascript">window.RICH_FACES_EXTENDED_SKINNING_ON=true;</script><script src="/Ozi2Web/a4j/g/3_3_0.GAorg/richfaces/renderkit/html/scripts/skinning.js.jsf" type="text/javascript"></script><meta http-equiv="Content-Style-Type" content="text/css" />
            


            Thanks for all responses.

            • 3. Re: Problem with rendering richfaces elements
              Luke Twardowsky Newbie

              When I launch this application in IE I get js error:'No definition for RichFaces' so I think it's problem with loading libraries. I have RichFaces libs in /WEB-INF/lib. Should they also be on server?!

              Thanks for all responses.

              • 4. Re: Problem with rendering richfaces elements
                Luke Twardowsky Newbie

                Problem was in web.xml:

                <display-name>RichFaces Filter</display-name>
                <filter-name>richfaces</filter-name>
                <filter-class>org.ajax4jsf.Filter</filter-class>

                <filter-mapping>
                <filter-name>richfaces</filter-name>
                <servlet-name>dispatcher</servlet-name> - here should be name of <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
                REQUEST
                FORWARD
                INCLUDE
                </filter-mapping>