-
1. Re: applying css styles to command button
healeyb Sep 3, 2012 8:50 AM (in response to wingman)[edit - various typos now corrected]
you must have some other css that's being applied to the commandButton. Don't forget that it's an html input, so if
you want css to apply only to an inputText you need to use:
input[type="text"], input[type="password"] {
...
}
and
input[type="submit"], input[type="reset"], input[type="button"] {
...
}
for a h:commandButton. I've seen this specific problem before with a commandButton getting half a background
- hmmm what was it now... you don't have a background image on any other input components perhaps?
Hang on, it's because you've got richfaces styling enabled. I use this in web.xml to have normal styling:
<context-param>
<param-name>org.richfaces.enableControlSkinning</param-name>
<param-value>false</param-value>
</context-param>
Because you are using the richfaces styling background-image, background-position and background-repeat
are applied from skinning.css, guess you just need to override these.
This jquery will totally unstyle h:inputText id="input1", I had to unbind the javascript events but I can't remember
if this was for primefaces or richfaces, so the unbind line may not be needed.
jQuery(function($) {
$('#input1').removeClass();
$('#input1').unbind("mouseenter focus mouseleave");
});
Regards,
Brendan.