4 Replies Latest reply on Jul 26, 2012 1:58 PM by s.santilli

    Extend richfacees rf-tab-cnt css class?

    s.santilli Newbie

      Hi Everyone,

       

       

      Does anyone know how to extend a richfaces css class? I have bee trying to

      extend a rf-tab-cnt class imposed by the rich:tab element, but the following

      is not working in the xhtml page.

       

      -------------------------------------------------------------------

      <style type="text/css">

       

      #firstTabId  .rf-tab-cnt{

         padding: 0px;

      }

       

      </style>

       

      .....

      .....

       

      <rich:tabPanel>

       

         <rich:tab id="firstTabId" name="myfirstTab">

        </rich:tab>

       

      </rich:tabPanel>

       

      .....

      .....

      --------------------------------------------------------------------

       

      However, this is not working at all, and no effect or change

      is generated. Also, I need this to effect only the one tab,

      hence the use of the tab id. Perhaps I am missing something

      in my theory as I thought this was correct?

       

      Nonetheless, running out of ideas, any help is greatly

      appreciated.

       

      Thanks

        • 1. Re: Extend richfacees rf-tab-cnt css class?
          ibstmt Newbie

          I think you want to use the "styleClass" attribute on the tab, not "id":

           

          <rich:tab  styleClass="my-style">

           

          .my-style

          {

               padding: 0px;

          }

           

           

          Also, in my experience, if I need to have a custom version of a RF style, I create my own version of it, with the same name, in my .css file. I don't need to refer to the name, because Richfaces is already going to look for it by default.

           

          .rf-tab-cnt {

             padding: 0px;

          }

          • 2. Re: Extend richfacees rf-tab-cnt css class?
            s.santilli Newbie

            Hi ibstmt,

             

            I wanted to thank-you for your attempt, however I also wanted to clarify

            that your post is not correct in the event someone stumbles upon

            it, wanting to try it to no avail.

             

            Also, in my experience, if I need to have a custom version of a RF style, I create my own version of it, with the same

            name, in my .css file. I don't need to refer to the name, because Richfaces is already going to look for it by default.

             

            My goal is to have only the one tab effected by my desired padding change. Your suggestion

            (I'm sure most think of) would effect more than the one tab, in fact overwriting the rf-tab-cnt

            would effect the rich faces implemented css class, throughout the entire project ... again

            not my goal as stated.

             

            I think you want to use the "styleClass" attribute on the tab, not "id":

             

            Using the styleClass, effect those elements that inherit the class styleClass="myStyle"

            however, the rf-tab-cnt still presists its undesired padding in the tab inquestion

            even when the new class inherits it.

             

            For example:

             

            <rich:tabPanel>

             

               <rich:tab id="firstTabId" name="myStyle">

              </rich:tab>

             

            </rich:tabPanel>

             

            Again the padding from rf-tab-cnt is not removed.

             

            Any other suggestions, I greatly appreciate it.

            • 3. Re: Extend richfacees rf-tab-cnt css class?
              ibstmt Newbie

              Regardless, what you are doing will not work.  Richfaces component styles are determined by either the underlying CSS style built into RF, or by "style" or "styleClass" attributes. Using "id" or "name" has nothing to do with styles (unlike, say, a <div statement).

              • 4. Re: Extend richfacees rf-tab-cnt css class?
                s.santilli Newbie

                Hi Ibstmt,

                 

                Thank-you again

                 

                Richfaces component styles are determined by either the underlying CSS style built into RF, or by "style" or "styleClass" attributes.

                Using "id" or "name" has nothing to do with styles (unlike, say, a <div statement).

                 

                Yes agreed, hence the purpose of this post ... I thought it would be beneficial for documentation

                purpose to illustrate my train of though and what my end desire is.

                 

                Previously (in a past life, lol), I've came across instances where it is possible to apply CSS to only selected

                element id's. I was hoping the same could be done with richface ... OR ... at the very least extend

                a richfaces css class, again in my ultimate attempt to override the padding associated with the richfaces

                tab rf-tab-cnt css class.

                 

                At mentioned, none of these avenues have worked ... should any others come to

                mind, I extend my gratitude.

                 

                Thanks