2 Replies Latest reply on Sep 8, 2010 2:35 AM by Ilya Shaikovsky

    Why width of rich:comboBox has to be given in pixels?

    Piotr Sobczyk Newbie

      I just want for my rich:comboBox to fill it's container in width. But rich:comboBox has explicitly set default width of 150px. So I'm setting width attribute of rich:comboBox tag to width="100%" but then I get some parse error:

       

      java.lang.StringIndexOutOfBoundsException: String index out of range: -1
           at java.lang.String.substring(String.java:1937)
           at org.richfaces.renderkit.html.ComboBoxRenderer.doEncodeEnd(ComboBoxRenderer.java:234)
           at org.richfaces.renderkit.html.ComboBoxRenderer.doEncodeEnd(ComboBoxRenderer.java:587)
           at org.ajax4jsf.renderkit.RendererBase.encodeEnd(RendererBase.java:134)

      So, like documentation of rich:comboBox confirms a width has to be given in pixels:

       

      But from what I see in Firebug width attibute of rich:comboBox is just translated to atribute style="width:.." of a div element surrounding generated combo box markup. So why can't someone just give width in percents like CSS syntax allows?

       

      Is there any other straightforward way to make rich:comboBox's width fill it's container without specifying it explicitly in pixels? I don't know exactly how wide will my container be.