6 Replies Latest reply on Dec 9, 2011 4:47 AM by kh.ramana

    h:selectOneMenu style

    lenyas66

      I need to change background color and button color for  h:selectOneMenu component. Could anybody tell me how to do it?

       

      Somehow, I couldn't find style attributes for this component online.

        • 1. Re: h:selectOneMenu style
          ssilvert

          I've never tried it myself, but I think the selectOneMenu attributes you are looking for are enabledClass and disabledClass.  These tell which CSS class to use when the menu is enabled and disabled.

           

          Stan

          • 2. Re: h:selectOneMenu style

            Hi,

             

            I have given a background color to the h:selectOneMenu by using the below code:

             

                                     <h:selectOneMenu value="#{LoginAction.locale}" styleClass="alignLeft;" valueChangeListener="#{LoginAction.changeLanguage}"                               immediate="true" style="background-color:yellow;">
                                             <a4j:support event="onchange" reRender="loginForm" limitToList="true" immediate="true"/>
                                             <f:selectItem itemValue="en" itemLabel="English" />
                                             <f:selectItem itemValue="es" itemLabel="Español" />
                                    </h:selectOneMenu>

             

            I have a requirement for changing the background of the value  in h:SelectOneMenu when the mouse is over the value.I mean the value  which the mouse points to should be highLighted i.e if have 10 values in  the drop down when my mouse is on the second value in dropdown the  value should be highlighted in yellow whereas the others should not be  highlighted.
            I tried using onmouseover attribute but it jut mess up  my logic when mouse is over the dropdown all values are highLighted.

             

             

            Thanks and Regards,

            JSFDEveloper

            • 3. Re: h:selectOneMenu style
              lenyas66

              I see how to change background color, but how to change the color of a button with down arrow?

              • 4. Re: h:selectOneMenu style
                yaseralhs

                how to change the color of a button with down arrow?

                • 5. Re: h:selectOneMenu style
                  yaseralhs

                  ?

                  • 6. Re: h:selectOneMenu style
                    kh.ramana

                    Do any one found the solution to change the down arrow with different color?