9 Replies Latest reply on Apr 11, 2014 4:27 AM by result

    rich:select render problem

    amareno

      Hi,

       

      I have a UI problem on my application, using the rich:select component. (RichFaces 4.3.4 FInal)

       

      I have a rich:select component nested in a <div id="appContainer">, nested in another <div id="appBody"> that has <style> position: absolute; with the bottom attribute set.

      The <div id="appContainer"> has an height value, enough to make the vertical scrollbar to apper.

       

       

      In this situation, if :

      1. open the rich:select box and leaving it open
      2. scroll down the page with mouse wheel(Firefox, Chrome, Explorer) or moving the vertical scrollbar (Firefox, Chrome)

       

      You see that the list box of the rich:select component is detaching from the component. (see attached image)

       

      Does it is a richfaces bug?

       

      Thank you for any help.

       

      Here images, before and after the scrolling action

      beforeScroll.JPG

       

      afterScroll.JPG

       

      Code example

       

      <!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"
          xmlns:h="http://java.sun.com/jsf/html"
          xmlns:a4j="http://richfaces.org/a4j"
          xmlns:rich="http://richfaces.org/rich"
          xmlns:f="http://java.sun.com/jsf/core"
          xmlns:ui="http://java.sun.com/jsf/facelets">
      
      
      <h:head>
          <style type="text/css">
      #appBody {
        border: solid 2px red;
        position: absolute;
        top: 10px;
        bottom: 10px;
        left: 10px;
        right: 10px;
        overflow-x: hidden;
        overflow-y: auto;
        left: 10px;
        right: 10px;
      }
      
      
      #appContent {
        border: solid 2px green;
        margin: 5px;
        height: 1500px;
        width: 100%;
        height: 1500px;
      }
      </style>
      </h:head>
      <body>
          <div id="appBody">
              <h:outputText value="Body DIV"></h:outputText>
              <div id="appContent">
                  <h:outputText value="Content DIV"></h:outputText>
                  <div style="height: 60px;"></div>
                  <h:form>
                      <h:outputLabel value="Bugged select: " />
                      <rich:select id="theSelect" maxListHeight="200px"
                          enableManualInput="true">
                          <f:selectItem itemLabel="zero" itemValue="0" />
                          <f:selectItem itemLabel="one" itemValue="1" />
                          <f:selectItem itemLabel="two" itemValue="2" />
                          <f:selectItem itemLabel="three" itemValue="3" />
                          <f:selectItem itemLabel="four" itemValue="4" />
                          <f:selectItem itemLabel="five" itemValue="5" />
                          <f:selectItem itemLabel="six" itemValue="6" />
                          <f:selectItem itemLabel="seven" itemValue="7" />
                          <f:selectItem itemLabel="eight" itemValue="8" />
                          <f:selectItem itemLabel="nine" itemValue="9" />
                      </rich:select>
                  </h:form>
              </div>
          </div>
      </body>
      </html>
      
        • 1. Re: rich:select render problem
          bleathem

          I suspect this is related to the absolute positioning of your appBody div.  If you remove that, do you still have this problem?

          • 2. Re: rich:select render problem
            amareno

            Hi Brian,

             

            yes, if I remove the absolute positioning the rich:select works correctly.

            Also works if I only remove the "bottom: 10px; " from the #appBody.

             

            But unfortunately, this sample is a fragment of code extracted  from a huge application and purged to put in evidence the issue.

            I can't remove the absolute positioning of the body div.

             

            Do you have any suggestion? Should this component works also with absolute positioning?

             

            Thank you

            • 3. Re: rich:select render problem
              bleathem

              You could try setting the CSS style of the popup to absolute positioning.

              • 4. Re: rich:select render problem
                amareno

                Are you suggesting to add position: absolute to the style of #theSelect component id?

                 

                I tried to set "position: absolute" to:

                 

                1. directly to the theSelect component id.
                2. to a class set as styleClass attribute of richSelect
                3. to the .rf-sel-lst-cord
                4. to the .rf-sel-lst-dcrtn

                 

                but with bad results.

                 

                Could you add more details?

                • 5. Re: Re: rich:select render problem
                  bleathem

                  Try applying the position:abosulte rule to the popup div of the select component, eg:

                   

                  .rf-sel-lst-cord {
                  position: absolute;
                  }
                  
                  • 6. Re: rich:select render problem
                    amareno

                    It was attempt no 3. It doesn't work.

                    • 7. Re: rich:select render problem
                      bleathem

                      Yeah, I haven't tried what you are asking for, I was just suggesting a place to start.  Keep trying and if you have some specific questions (or if you come across a solution) please post back here.

                      • 8. Re: rich:select render problem
                        amareno

                        Thank you Brian,

                        sure I'll keep trying to solve the issue, and update here if I found something useful.

                        In the meanwhile, I'll open a bug report to track the issue.

                        • 9. Re: rich:select render problem
                          result

                          Hi,

                          I've encountered this problem too. I've used the ListBox in Popup window. First, I've tried to solve it using CSS and i've found out that using .rf-sel-lst-cord { position: fixed; } works, but when i've updated selector to .rf-pp-cntr .rf-sel-lst-cord to match the right tags it couldn't find anything. So, I've decided to use rich:jQuery component in the popup, which was causing the problem. Code snippet looks like this:

                          <rich:jQuery selector=".rf-pp-cntr .rf-sel-lst-cord" timming="onload"
                          query="css('position', 'fixed');" />