O'Reilly logo

PrimeFaces Beginner's Guide by K. Siva Prasad Reddy

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Time for action – displaying a pop-up Calendar with navigator

Let us see how we can display a pop-up Calendar component when a button is clicked with the custom date format and navigator features.

To do this, create the <p:calendar> component using the navigator and pattern attributes:

<p:calendar value="#{userController.registeredUser.dob}" showOn="button" navigator="true" pattern="EEE, dd MMM, yyyy"/>

What just happened?

We have created a Calendar component and configured it to be displayed when a button icon is clicked on, using the showOn attribute. As we have set navigator="true", year and month drop-down lists are displayed for easy navigation. Also, we have customized the date format to be displayed in the EEE, dd MMM, yyyy format using the ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required