4 Replies Latest reply on Dec 14, 2010 7:36 AM by gerald crown

    sidebarClass not rendered

    gerald crown Newbie

      Hello,

       

      I have defined a rich:page and in my css file I have added a style class for the sidebar. But it is not rendered correctly and the default styles are loaded instead. I am using richfaces 3.3.3. Here is my rich page:

       

      <rich:page xmlns="http://www.w3.org/1999/xhtml"
      xmlns:a4j="http://richfaces.org/a4j" contentType="text/html"
      pageTitle="#{msg.pagetitle}"  markupType="xhtml"
      sidebarWidth="100" sidebarClass="rich-page-sidebar" sidebarPosition="left" styleClass="rich-page">
      <f:loadBundle basename="wui.messages" var="msg" />
      <link href="${facesContext.externalContext.requestContextPath}/custom/css/group.css" rel="stylesheet" type="text/css" />

      <rich:page xmlns="http://www.w3.org/1999/xhtml"

      xmlns:f="http://java.sun.com/jsf/core"

      xmlns:h="http://java.sun.com/jsf/html"

      xmlns:ui="http://java.sun.com/jsf/facelets"

      xmlns:wui="http://www.bmw.com/facelets/wui"

      xmlns:rich="http://richfaces.org/rich"

      xmlns:a4j="http://richfaces.org/a4j" contentType="text/html"

      pageTitle="#{msg.pagetitle}"  markupType="xhtml"

      sidebarWidth="100" sidebarClass="rich-page-sidebar" sidebarPosition="left" styleClass="rich-page">

      <f:loadBundle basename="wui.messages" var="msg" />

      <link href="${facesContext.externalContext.requestContextPath}/custom/css/group.css" rel="stylesheet" type="text/css" />

      ....

        • 1. Re: sidebarClass not rendered
          Nick Belaevski Master

          Hi,

           

          LINK should be placed into 'pageHeader' facet. Also you can replace LINK with a4j:loadStyle and get a simpler page code.

          • 2. Re: sidebarClass not rendered
            gerald crown Newbie

            Nick,

            Thanks for the suggestion. I tried it and it still does not render. I even tried putting the style tag into the pageHeader but the defaults are still loaded.

            Here is the generated source. I underlined where richfaces is inserting the style code for the page:

             

             

            <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
            <html lang="en" xmlns="http://www.w3.org/1999/xhtml"><head><title>FeNATA</title><link class="component" href="/FeNATA/faces/a4j/s/3_3_3.Finalorg/richfaces/renderkit/html/css/basic_both.xcss/DATB/eAET5dszM3T5DGkADQsDKA__" rel="stylesheet" type="text/css" /><link class="component" href="/FeNATA/faces/a4j/s/3_3_3.Finalorg/richfaces/renderkit/html/css/extended_both.xcss/DATB/eAET5dszM3T5DGkADQsDKA__" media="rich-extended-skinning" rel="stylesheet" type="text/css" /><link class="component" href="/FeNATA/faces/a4j/s/3_3_3.Final/org/richfaces/skin.xcss/DATB/eAET5dszM3T5DGkADQsDKA__" rel="stylesheet" type="text/css" /><script src="/FeNATA/faces/a4j/g/3_3_3.Finalorg.ajax4jsf.javascript.PrototypeScript" type="text/javascript"></script><script src="/FeNATA/faces/a4j/g/3_3_3.Finalscripts/comboboxUtils.js" type="text/javascript"></script><script src="/FeNATA/faces/a4j/g/3_3_3.Finalscripts/utils.js" type="text/javascript"></script><script src="/FeNATA/faces/a4j/g/3_3_3.Finalscripts/inplaceinputstyles.js" type="text/javascript"></script><script src="/FeNATA/faces/a4j/g/3_3_3.Finalscripts/inplaceinput.js" type="text/javascript"></script><script src="/FeNATA/faces/a4j/g/3_3_3.Finalorg.ajax4jsf.javascript.AjaxScript" type="text/javascript"></script><script src="/FeNATA/faces/a4j/g/3_3_3.Finalscripts/menu.js" type="text/javascript"></script><script src="/FeNATA/faces/a4j/g/3_3_3.Finalorg/richfaces/renderkit/html/scripts/utils.js" type="text/javascript"></script><script src="/FeNATA/faces/a4j/g/3_3_3.Finalorg/ajax4jsf/javascript/scripts/form.js" type="text/javascript"></script><script src="/FeNATA/faces/a4j/g/3_3_3.Finalorg/richfaces/renderkit/html/scripts/form.js" type="text/javascript"></script><script src="/FeNATA/faces/a4j/g/3_3_3.Finalorg/richfaces/renderkit/html/scripts/menu.js" type="text/javascript"></script><script type="text/javascript">window.RICH_FACES_EXTENDED_SKINNING_ON=true;</script><script src="/FeNATA/faces/a4j/g/3_3_3.Finalorg/richfaces/renderkit/html/scripts/skinning.js" type="text/javascript"></script><style type="text/css">.rich-page{margin:auto 10px;width:auto;}
            .rich-page-main{float:right;margin-left:-30em;}
            .rich-page-sidebar{float:left;width:7.6923075em;*width:7.5001874em;}
            .rich-page-body{margin-left:8.692307em;*marginleft:8.475187em;}
            .rich-page-body{float:none;width:auto;}
            </style>
            <style>
            .bmwSideBar {
            background-color: #E0E0E0;
            height: 100%;
            }
            </style>
            <link href="/FeNATA/custom/css/group.css" rel="stylesheet" type="text/css" /></head><body><div class="rich-page " id="j_id0"><div class="rich-page-header " id="j_id0:hd"><div class="rich-page-header-content" id="j_id0:hdc"><span id="headerpanel"><div style=""><div width="800"><table border="0" cellpadding="0" cellspacing="0" class="rich-toolbar " height="30" id="upperbar" width="100%"><tr valign="middle"><td class="rich-toolbar-item  " style=";">item1</td><td align="center"><img src="/FeNATA/faces/a4j/g/3_3_3.Finalorg.richfaces.renderkit.html.images.LineSeparatorImage/DATB/eAE7fv7KgwcPGICAm0ECADTRBS4_" alt="" /></td><td class="rich-toolbar-item  " style=";">item2</td><td align="center"><img src="/FeNATA/faces/a4j/g/3_3_3.Finalorg.richfaces.renderkit.html.images.LineSeparatorImage/DATB/eAE7fv7KgwcPGICAm0ECADTRBS4_" alt="" /></td><td class="rich-toolbar-item  " style=";">item3</td><td align="center"><img src="/FeNATA/faces/a4j/g/3_3_3.Finalorg.richfaces.renderkit.html.images.LineSeparatorImage/DATB/eAE7fv7KgwcPGICAm0ECADTRBS4_" alt="" /></td><td class="rich-toolbar-item  " style=";">item4</td><td style="width:100%"></td></tr></table></div><div align="left" width="105" style="float:left;width:105;*width:105;"><img id="portalheaderleft" src="/FeNATA/custom/img/portalheader_background_bmwgroup.gif" height="65" width="99" /></div><div width="535" style="float:left;width:535;*width:535;">
            <h1>FeNATA</h1>
            <h2>FeNATA Motor Quality</h2></div><div align="right" width="160" style="float:right;width:160;*width:160;"><img id="portalheaderright" src="/FeNATA/custom/img/portalheader_logo_bmwgroup.gif" height="65" width="160" /></div><div style="display: block; height: 0;line-height:0px; font-size:0px; clear: both; visibility: hidden;">.</div><div width="800"><table border="0" cellpadding="0" cellspacing="0" class="rich-toolbar " height="30" id="lowerbar" width="100%"><tr valign="middle"><td class="rich-toolbar-item  " style=";">item1</td><td align="center"><img src="/FeNATA/faces/a4j/g/3_3_3.Finalorg.richfaces.renderkit.html.images.LineSeparatorImage/DATB/eAE7fv7KgwcPGICAm0ECADTRBS4_" alt="" /></td><td class="rich-toolbar-item  " style=";">item2</td><td align="center"><img src="/FeNATA/faces/a4j/g/3_3_3.Finalorg.richfaces.renderkit.html.images.LineSeparatorImage/DATB/eAE7fv7KgwcPGICAm0ECADTRBS4_" alt="" /></td><td class="rich-toolbar-item  " style=";">item3</td><td align="center"><img src="/FeNATA/faces/a4j/g/3_3_3.Finalorg.richfaces.renderkit.html.images.LineSeparatorImage/DATB/eAE7fv7KgwcPGICAm0ECADTRBS4_" alt="" /></td><td class="rich-toolbar-item  " style=";">item4</td><td style="width:100%"></td></tr></table></div></div></span></div></div><div class="rich-page-content " id="j_id0:cnt"><div class="rich-page-sidebar bmwsidebar"><table class="vertical-menu-cell" width="75">
            <tbody>

            <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"

            "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

            <html lang="en" xmlns="http://www.w3.org/1999/xhtml"><head><title>FeNATA</title><link class="component" href="/FeNATA/faces/a4j/s/3_3_3.Finalorg/richfaces/renderkit/html/css/basic_both.xcss/DATB/eAET5dszM3T5DGkADQsDKA__" rel="stylesheet" type="text/css" /><link class="component" href="/FeNATA/faces/a4j/s/3_3_3.Finalorg/richfaces/renderkit/html/css/extended_both.xcss/DATB/eAET5dszM3T5DGkADQsDKA__" media="rich-extended-skinning" rel="stylesheet" type="text/css" /><link class="component" href="/FeNATA/faces/a4j/s/3_3_3.Final/org/richfaces/skin.xcss/DATB/eAET5dszM3T5DGkADQsDKA__" rel="stylesheet" type="text/css" /><script src="/FeNATA/faces/a4j/g/3_3_3.Finalorg.ajax4jsf.javascript.PrototypeScript" type="text/javascript"></script><script src="/FeNATA/faces/a4j/g/3_3_3.Finalscripts/comboboxUtils.js" type="text/javascript"></script><script src="/FeNATA/faces/a4j/g/3_3_3.Finalscripts/utils.js" type="text/javascript"></script><script src="/FeNATA/faces/a4j/g/3_3_3.Finalscripts/inplaceinputstyles.js" type="text/javascript"></script><script src="/FeNATA/faces/a4j/g/3_3_3.Finalscripts/inplaceinput.js" type="text/javascript"></script><script src="/FeNATA/faces/a4j/g/3_3_3.Finalorg.ajax4jsf.javascript.AjaxScript" type="text/javascript"></script><script src="/FeNATA/faces/a4j/g/3_3_3.Finalscripts/menu.js" type="text/javascript"></script><script src="/FeNATA/faces/a4j/g/3_3_3.Finalorg/richfaces/renderkit/html/scripts/utils.js" type="text/javascript"></script><script src="/FeNATA/faces/a4j/g/3_3_3.Finalorg/ajax4jsf/javascript/scripts/form.js" type="text/javascript"></script><script src="/FeNATA/faces/a4j/g/3_3_3.Finalorg/richfaces/renderkit/html/scripts/form.js" type="text/javascript"></script><script src="/FeNATA/faces/a4j/g/3_3_3.Finalorg/richfaces/renderkit/html/scripts/menu.js" type="text/javascript"></script><script type="text/javascript">window.RICH_FACES_EXTENDED_SKINNING_ON=true;</script><script src="/FeNATA/faces/a4j/g/3_3_3.Finalorg/richfaces/renderkit/html/scripts/skinning.js" type="text/javascript"></script><style type="text/css">.rich-page{margin:auto 10px;width:auto;}

            .rich-page-main{float:right;margin-left:-30em;}

            .rich-page-sidebar{float:left;width:7.6923075em;*width:7.5001874em;}

            .rich-page-body{margin-left:8.692307em;*marginleft:8.475187em;}

            .rich-page-body{float:none;width:auto;}

            </style>

            <style>

            .rich-page-sidebar{

            background-color: #E0E0E0;

            height: 100%;

            }

            </style>

            <link href="/FeNATA/custom/css/group.css" rel="stylesheet" type="text/css" /></head><body><div class="rich-page " id="j_id0"><div class="rich-page-header " id="j_id0:hd"><div class="rich-page-header-content" id="j_id0:hdc"><span id="headerpanel"><div style=""><div width="800"> ......

             

            my page is as follows:

             

            <rich:page xmlns="http://www.w3.org/1999/xhtml"

            xmlns:f="http://java.sun.com/jsf/core"

            xmlns:h="http://java.sun.com/jsf/html"

            xmlns:ui="http://java.sun.com/jsf/facelets"

            xmlns:rich="http://richfaces.org/rich"

            xmlns:a4j="http://richfaces.org/a4j" contentType="text/html"

            pageTitle="#{msg.pagetitle}"  markupType="xhtml"

            sidebarWidth="100" sidebarClass="rich-page-sidebar" sidebarPosition="left" styleClass="rich-page">

            <f:loadBundle basename="wui.messages" var="msg" />

            <f:facet name="pageHeader">

            <style>

            .rich-page-sidebar{

            background-color: #E0E0E0;

            height: 100%;

            }

            </style>

            <link href="${facesContext.externalContext.requestContextPath}/custom/css/group.css" rel="stylesheet" type="text/css" />

            </f:facet>

            <f:facet name="sidebar" id="sidebar">

             

            • 3. Re: sidebarClass not rendered
              Nick Belaevski Master

              So I see both custom styles declarations were placed in the correct place. Check path to your CSS file and also you must add required attribute 'type' to STYLE element.

              • 4. Re: sidebarClass not rendered
                gerald crown Newbie

                Thanks for the advice. Added the type in the style and the CSS style sheet is working for other JSF core components.However the sidebar is still not rendering correctly.

                <context-param>
                  <param-name>org.richfaces.CONTROL_SKINNING</param-name>
                  <param-value>enable</param-value>
                </context-param>
                <context-param>
                  <param-name>org.richfaces.CONTROL_SKINNING_CLASSES</param-name>
                  <param-value>enable</param-value>
                </context-param>
                <context-param>
                  <param-name>org.richfaces.CONTROL_SKINNING_LEVEL</param-name>
                  <param-value>extended</param-value>
                </context-param>
                <context-param>
                  <param-name>org.richfaces.LoadStyleStrategy</param-name>
                  <param-value>ALL</param-value>
                </context-param