2.2.1 p:caldendar and inputMask - they look strange

UI Components for JSF
OneCent
Posts: 38
Joined: 10 Sep 2010, 16:25
Contact:

16 Feb 2011, 13:12

Hi

I have some "problems" with the 2.2.1, i did not have them with 2.2.RC2.

As you can see in the picture, the fields do look strange with 2.2.0 and 2.2.1 . Any Idea where i should look or what i should check?

Image

1) p:calendar

Code: Select all

 <h:outputLabel value="#{i18nBean.getText('Geburtsdatum')}" for="Geburtsdatum"/>
                                    <p:calendar value="#{natuerlichePersonBean.gateway.subject.geburtsdatum}"
                                                locale="de"
                                                showButtonPanel="true"
                                                yearRange="1900"
                                                navigator="true"
                                                effect="fadeIn"
                                                pages="1"
                                                mode="popup"
                                                showOn="button"
                                                pattern="dd.MM.yyyy"
                                                id="Geburtsdatum"/>
                                    <h:outputLabel value=""/>
2) p:inputMask

Code: Select all

<h:outputLabel value="#{i18nBean.getText('SvNummer')}" for="svNummer"/>
                                    <p:inputMask mask="9999999999999"   id="svNummer" value="#{natuerlichePersonBean.gateway.subject.svNummer}"  size="26" />
                                    <h:outputLabel value=""/>
- Screenshot is made on a Mac with Safari
- 2.2.RC2 did not have that problem
- Runs on GF and Mojarra 2.0.4-b09
Mojarra 2.0.4 / Glassfish v3.1 / Primefaces 2.2.1 / Netbeans 7 / OS X

User avatar
bumble.bee
Posts: 723
Joined: 29 Sep 2010, 21:39
Location: United States

16 Feb 2011, 15:33

In 2.2 form control styling was introduced. Unfortunately the calendar and inputmask components don't have an option to be styled or not (they are styled regardless of if you want them to be or not). With the other components like inputText and inputTextarea you have a choice because the PrimeFaces versions mostly only add styling so you can decide to have styled form controls or not by using the PrimeFaces component or using the plain JSF component equivalent (Note: the p:inputTextarea does add an auto expand feature so in that case you have to accept the styling to get it).

Here is the announcement: http://primefaces.prime.com.tr/forum/vi ... f=3&t=7330

In 3.0 form controls are being refined: http://primefaces.prime.com.tr/forum/vi ... f=3&t=7787

User avatar
Oleg
Expert Member
Posts: 3805
Joined: 02 Oct 2009, 09:41
Location: Germany, Black Forest

16 Feb 2011, 15:59

I agree. Calendar, inputMask, spinner, ... all input fields get automatically the CSS selector ui-inputfield. But the documentation doesn't mention this selector at all. I don't want to have e.g. shadow and bold font in input elements and had to write

Code: Select all

.ui-inputfield {
    -moz-box-shadow: none !important;
    font-weight: normal !important;
}
And I want to use "native" h:input, h:select... tags, but it's very hard to design "native" and PF's components (like p:calendar or p:spinner), so that they have an unifed Look&Feel. I have to assign ui-inputfield selector to all "native" components.

I found some other lacks in the docu regarding to CSS selectors (thanks Firebug!). PF has e.g. not documented selectors in theme.css files

Code: Select all

/* PrimeFaces Extensions */
...

.ui-inputfield.ui-state-focus {
    -moz-box-shadow: 0px 0px 5px #74b2e2, inset 0 2px 2px #74b2e2 !important;
    -webkit-box-shadow: 0px 0px 5px #74b2e2, inset 0 2px 2px #74b2e2 !important;
    box-shadow: 0px 0px 5px #74b2e2, inset 0 2px 2px #74b2e2 !important;
}
Last edited by Oleg on 16 Feb 2011, 16:37, edited 3 times in total.
PrimeFaces Cookbook (2. edition): http://ova2.github.io/primefaces-cookbook/ Learning Angular UI Development with PrimeNG: https://github.com/ova2/angular-develop ... th-primeng Blog: https://medium.com/@OlegVaraksin

MikeK
Posts: 104
Joined: 13 Oct 2010, 15:07

16 Feb 2011, 16:00

I have this issue as well. It looks odd to have my calendar inputs look different than everything else. It would be a great option to turn off Themes for form controls.
Prime Faces 6.2
Mojarra 2.2.14
Apache Tomcat 9.0
Internet Explorer 10,11

User avatar
Oleg
Expert Member
Posts: 3805
Joined: 02 Oct 2009, 09:41
Location: Germany, Black Forest

16 Feb 2011, 16:06

Yes, that's what I meant. My calendar and spinner look different than all other components as well. Created an issue: http://code.google.com/p/primefaces/iss ... il?id=1749

This feature will be handy for all people that don't plan to use p:input, p:textarea, p:select... components, but depend on components not covering by JSF impl. like p:calendar, p:spinner, p:inputMask.

Please vote!
PrimeFaces Cookbook (2. edition): http://ova2.github.io/primefaces-cookbook/ Learning Angular UI Development with PrimeNG: https://github.com/ova2/angular-develop ... th-primeng Blog: https://medium.com/@OlegVaraksin

cagatay.civici
Prime
Posts: 18616
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

16 Feb 2011, 16:42

Just override ui-inputfield to reset how they look, it is a global selector that applies every input field.

User avatar
Oleg
Expert Member
Posts: 3805
Joined: 02 Oct 2009, 09:41
Location: Germany, Black Forest

16 Feb 2011, 17:21

Ok, I'm satisfied, but I would write in theme.css

Code: Select all

.ui-inputfield:focus {
...
}
additional to

Code: Select all

.ui-inputfield.ui-state-focus {
...
}
because we can only set .ui-state-focus by JavaScript. I set now ui-inputfield for all h:... components, but I can not easy adjust all places for .ui-state-focus. Pseudoselector :focus is handled automatically by browser and we would nothing need to do. Can you add :focus please?

For ui-state-hover and :hover is the same.
PrimeFaces Cookbook (2. edition): http://ova2.github.io/primefaces-cookbook/ Learning Angular UI Development with PrimeNG: https://github.com/ova2/angular-develop ... th-primeng Blog: https://medium.com/@OlegVaraksin

User avatar
Oleg
Expert Member
Posts: 3805
Joined: 02 Oct 2009, 09:41
Location: Germany, Black Forest

16 Feb 2011, 19:46

Yet another thing. Input elements of p:calendar, p:spinner, p:inputMask get CSS selectorts ui-inputfield ui-widget ui-state-default ui-corner-...

In Safari these fields don't show shadow by hover / focus even I manipulate ui-inputfield. Other h:inputs show shadow by browser standard behavior. The question is now - how to achieve one Look&Feel? Don't matter, with shadow or without, I couldn't do this task succesfully cross-browser.
PrimeFaces Cookbook (2. edition): http://ova2.github.io/primefaces-cookbook/ Learning Angular UI Development with PrimeNG: https://github.com/ova2/angular-develop ... th-primeng Blog: https://medium.com/@OlegVaraksin

kotoshy
Posts: 1
Joined: 12 Mar 2011, 09:15

15 Mar 2011, 06:56

What countries officially use a different calendar than our Gregorian calendar? I think the Gregorian calendar is the most widely accepted "common currency" in our world. Are there countries using other calendars officially, excluding religious time-scale applications of their traditional calendars?
________________________________________
market samurai ~ marketsamurai ~ marketsamurai.com
Last edited by kotoshy on 17 Mar 2011, 10:01, edited 1 time in total.

User avatar
bumble.bee
Posts: 723
Joined: 29 Sep 2010, 21:39
Location: United States

15 Mar 2011, 14:15

What countries officially use a different calendar than our Gregorian calendar?
That is off-topic. Start your own thread (probably on a different forum since that question does not have anything to do with PrimeFaces)

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 45 guests