0 Replies Latest reply on Aug 27, 2010 11:20 AM by pjmlp

    Is Richfaces.ComboBox.setInputWidth() buggy?

    pjmlp

      Hi,

       

      this question relates to a previous one that I have posted, but it a bit difference, hence the new post.

       

      I am trying to redefine some of the comboBox CSS classes, but without sucess. Regardless of what I do, I always end up getting one pixel less in the comboBox, as you can see on the image.

      error.png

       

      Looking at the setInputWidth() code, I see the following:

       

       

      setInputWidth : function() {     var width; if (Richfaces.browser.isIE6) { width = parseInt(this.field.parentNode.style.width) - this.BUTTON_WIDTH; } else {     width = parseInt(this.field.parentNode.style.width)           - parseInt(Element.getStyle(this.field, Richfaces.borders.l))           - parseInt(Element.getStyle(this.field, Richfaces.paddings.l))           - parseInt(Element.getStyle(this.field, Richfaces.paddings.r))           - parseInt(Element.getStyle(this.field, Richfaces.borders.r));     width -= this.buttonBG.offsetWidth ? this.buttonBG.offsetWidth : this.BUTTON_WIDTH; } this.field.style.width = width + "px"; }

       

      The values for  Richfaces.borders.l, Richfaces.borders.r and  Richfaces.paddings.r is 0, only Richfaces.paddings.l is 1.

       

      Now the calculation above ends up removing a pixel on the right on the comboBox input field, as shown on the image above.

       

      Is the function buggy or am I doing something wrong?

       

      Thanks in advance,
      Paulo