Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

primefaces calendar input text how to change

I may customize input fields (change font, size, etc) in p:inputText, p:autocompelte, p:inputMask, but I have no idea how to change input text field for p:calendar.

Using .ui-datepicker-sth works fine for elements from the panel, but I can't find anything for changing input text field in p:calendar element. Can anyone help me, pls?

Mi.

like image 722
user1554219 Avatar asked Jul 26 '12 10:07

user1554219


4 Answers

To change the width of the input field for the p:calendar, the following worked for me using Primefaces 5.1.

I defined this in the CSS file:

.calendarClass input {
    width: 50px !important
}

The p:calendar component style class is set as:

<p:calendar id="fromdate" styleClass="calendarClass" .../>
like image 60
prasad_ Avatar answered Oct 18 '22 19:10

prasad_


In this case, as @Matt indicates, you should overwrite the ui-inputfield class. For example, to remove the border radius or the shadow (the same with the focus):

.ui-inputfield {
    border-radius:0px;
    box-shadow: none;
}

And then add your properties (border, font-size/weight...) to make the class to your liking.

like image 22
AdSsa Avatar answered Oct 18 '22 20:10

AdSsa


You can use size attribute directly for changing the size

like image 29
Vandana Acharya Avatar answered Oct 18 '22 21:10

Vandana Acharya


To change the width of the input field for the p:calendar you can use

<p:calendar inputStyleClass="dateTimeField" .../>

.dateTimeField{
   width: 200px;
}

or

<p:calendar inputStyle="width:200px" .../>

or

<p:calendar styleClass="dateTimeField".../>

.dateTimeField input {
   width:200px;
}

https://forum.primefaces.org/viewtopic.php?t=2610

like image 5
borchvm Avatar answered Oct 18 '22 21:10

borchvm