Search code examples
cssjsfrichfaces

rich:comboBox button location


How can i control the location of the dropdown button of rich:combobox? By default it's located on the right of the text element. I want it to be located on the left side of the text element.


Solution

  • You can refer to the official documentation to see which style class names are available for customizing the <rich:combobox> http://docs.jboss.org/richfaces/latest_3_3_X/en/devguide/html/rich_comboBox.html.

    I try with this setting and the drop down button is located on the left hand side now:

      <rich:comboBox>
                    <f:selectItem itemValue="suggestion 1"/>
                    <f:selectItem itemValue="suggestion 2"/>
                    <f:selectItem itemValue="suggestion 3"/>
                    <f:selectItem itemValue="suggestion 4"/>
                    <f:selectItem itemValue="suggestion 5"/>
        </rich:comboBox>
    

    and declare this style in the page:

    <style type="text/css">
    input.rich-combobox-button, input.rich-combobox-button-inactive, input.rich-combobox-button-disabled{
           left:0px;
    }
    
    .rich-combobox-input, .rich-combobox-input-disabled, .rich-combobox-input-inactive{
    font-weight:bold;
            text-align:center;
    }   
    </style>
    

    enter image description here