PrimeFaces inputs breaks Theme Roller standards

UI Components for JSF
Post Reply
User avatar
edvinsyse
Posts: 9
Joined: 26 May 2014, 17:04
Location: Norway
Contact:

19 Dec 2014, 22:38

When I install a custom Theme Roller theme created with http://jqueryui.com/themeroller/, text inputs gets the button background color. This is because PrimeFaces adds ui-state-default to the input. According to the spec, ui-state-default should only be applied to clickables. (http://learn.jquery.com/jquery-ui/theming/api/)

This seems like a bug in PrimeFaces. Is it possible to make PrimeFaces not add these classes to inputs?

I've Googled and searched this forum but can't find any mention of this, which seems weird; doesn't this bite everybody that create custom themes for PrimeFaces?

Any help would be greatly appreciated.
Edvin Syse
_________________________________________
PrimeFaces 5.1 | Wildfly 8.2.0-Final | Mojarra 2.2.8
Mac OS X 10.10.1, Chrome 40.0.2214.45

Niko.pf
Posts: 7
Joined: 14 Jul 2013, 20:24

14 Jan 2015, 14:18

Since nobody has answered I'll try. I ran into the same problem and inspecting the Primefaces themes I noticed that these define additional ".ui-inputfield" classes that override the background defined by ui-state-default. These classes are not present in the theme roller generated css. If you manually add them to the generated css file like e.g.

Code: Select all

.ui-inputfield, .ui-widget-content .ui-inputfield, .ui-widget-header .ui-inputfield {
    background: none repeat scroll 0 0 #ffffff;
    border: 1px solid #d9d9d9;
    color: #222222;
}
.ui-inputfield.ui-state-hover, .ui-widget-content .ui-inputfield.ui-state-hover, .ui-widget-header .ui-inputfield.ui-state-hover {
    border: 1px solid #66b3ff;
}
.ui-inputfield.ui-state-disabled, .ui-widget-content .ui-inputfield.ui-state-disabled, .ui-widget-header .ui-inputfield.ui-state-disabled {
    background-color: #eaeaea;
}
.ui-inputfield.ui-state-focus, .ui-widget-content .ui-inputfield.ui-state-focus, .ui-widget-header .ui-inputfield.ui-state-focus {
    border: 1px solid #3399ff;
} 
you can control the appearance of your input fields. I don't know why things are done this way, but at least this works.

cheers
Niko
Primefaces 3.5
Myfaces 2.1.12
JBoss AS 7.1.1

Mike_M.
Posts: 1
Joined: 03 Feb 2016, 19:18

03 Feb 2016, 19:24

Thank you, Niko. Your response was very helpful.

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 23 guests