Preface
PrimeFaces Extensions is a light-weight, community-driven component suite, built on top of the PrimeFaces library for the enhanced JSF 2.x applications. It provides newly created, advanced, and improved components along with useful converters, validators, utility functions, and Maven plugins to make web development easier. At the time of writing this book, the latest version of PrimeFaces Extensions was 1.2.1, which works very well with PrimeFaces 4.0 and the JSF 2.x libraries.
This book will guide you through the process of setting up, configuring, and applying the PrimeFaces Extensions components in your PrimeFaces-based applications. The components and its features are explained through sample use cases and practical examples from the web application in a step-by-step procedure. This is the first book written on the PrimeFaces Extensions technology to greatly extend your PrimeFaces applications. By the end of this book, you will be able to use the enhanced Extensions components in your PrimeFaces applications.
What this book covers
Chapter 1, Introducing PrimeFaces Extensions, introduces the PrimeFaces Extensions library along with its major features, setup, and configuration details by creating a simple Hello World application. This chapter also explains how to work with the PrimeFaces Extension project resources, community support, and showcase details to explore the components.
Chapter 2, Enhanced Form and Editor Components, introduces a JobHub application with its functional requirements and application design. After that, it explores the basic input and advanced, dynamic form components, advisory tooltip, remoteCommand, and editor components for registration-based applications.
Chapter 3, Layout and Screen Blocking Components, explains the web page structure with the layout components, Waypoint as a scroll context component to work with the infinite content loading, and the screen blocking components, such as BlockUI and Spotlight, for better user interactions in the web interface.
Chapter 4, The Enriched Data Container and QR Code Components, covers the MasterDetail component to represent the hierarchical data, cascading grid items to layout the design with the FluidGrid component, and newly added QR codes for the enterprise marketing applications.
Chapter 5, Time Tracking and Scheduling Components, explores the highly configured TimePicker component in time-valued applications, the TimeLine component for scheduling and manipulating events, and internationalization support for both these time components in multilanguage based applications.
Chapter 6, Extended Data Reporting and Image Components, explains the data reporting functionality with the exporter component, customized data reporting through the CustomExporter implementation, and image manipulation features using the Image components.
Chapter 7, Common Utility Solutions, Error Handling, and Plugins, covers the common utility components and functions to resolve problems occurring in daily development, exception handling through the AjaxErrorHandler component, and Maven resource plugins to optimize web resources in JSF applications.
Appendix, Exploring Extensions Component Tags and Their Attributes, contains the attributes for various component names. This chapter is available as a bonus chapter and can be downloaded from http://www.packtpub.com/sites/default/files/downloads/3247OS_Appendix.pdf.
What you need for this book
As a reader of this book, you need to install JDK 5 or a higher version and Maven on your machine along with the compatible JSF and the PrimeFaces libraries. Optionally, you can also use software such as Eclipse IDE, debugging tools such as Firebug, and developer tools to debug your applications.
To run the customized web applications mentioned in this book, we stored the projects in GitHub, and you can pull the projects for a better and quick practical experience.
The following list of software and tools will be used in the custom web projects mentioned in this book:
Java JDK 1.5+ from the official Oracle website (http://www.oracle.com/technetwork/java/javase/downloads/index.html)
Mojarra Java Server Faces' latest implementation version (https://javaserverfaces.java.net/download.html)
PrimeFaces' latest version from the PrimeFaces official site (http://www.primefaces.org/downloads.html)
The latest PrimeFaces Extensions version (http://primefaces-extensions.github.io/)
Eclipse from the official site (http://www.eclipse.org) or any other Java IDE
Apache Maven build tool from the official site (http://maven.apache.org/) to work with customized projects
Who this book is for
This book is targeted at intermediate and advanced level users (or developers) who already have prior working knowledge of PrimeFaces. Even though this book is written for experienced PrimeFaces users, it will be explained to the level of a newbie for PrimeFaces development. If you would like to enhance the PrimeFaces-based applications in an easy way, then this book is for you. Basic knowledge of JSF, PrimeFaces, and jQuery are the prerequisites required for this book.
Conventions
In this book, we provided the headings for major topics, components, and their features in a top-to-bottom hierarchical approach. The custom web application development is explained, starting with the JobHub in action heading as follows:
JobHub in action
Step 1
Step 2
Step 3
Also in this book, you will find a number of styles of text that distinguish between different kinds of information. Here are some examples of these styles, and an explanation of their meaning.
Code words in text, URL names, table headings and content, attribute names, filenames, commands and abbreviations, and so on are shown/highlighted as follows.
For example, the filenames and keywords are mentioned as follows:
"First we will create the layout.xhtml
page, which will render the HelloWorld
message in the center pane of the layout component."
A block of code is set as follows:
<pe:layout resizerTip="Resize Me" togglerTipClosed="Open Me" togglerTipOpen="Close Me"> <pe:layoutPane position="north"> North Block </pe:layoutPane> <pe:layoutPane position="east"> East Block </pe:layoutPane> <pe:layoutPane position="center"> <h1>Hello, Welcome to Primefaces Extensions world</h1> </pe:layoutPane> <pe:layoutPane position="west" size="200"> West Block </pe:layoutPane> <pe:layoutPane position="south"> South Block </pe:layoutPane> </pe:layout>
Any command-line input or output is written as follows:
The Maven run command for Oracle Mojarra is as follows:
mvn jetty:run
The Maven run command for Apache Myfaces is as follows:
mvn jetty:run -Pmyfaces
New terms and important words are shown in bold. Words that you see on the screen, in menus or dialog boxes for example, appear in the text like this: "Clicking on the TOP button scrolls the web page to the top of the screen."
Note
Warnings or important notes appear in a box like this.
Tip
Tips and tricks appear like this.
Reader feedback
Feedback from our readers is always welcome. Let us know what you think about this book—what you liked or may have disliked. Reader feedback is important for us to develop titles that you really get the most out of.
To send us general feedback, simply send an e-mail to <feedback@packtpub.com>
, and mention the book title via the subject of your message.
If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, see our author guide on www.packtpub.com/authors.
Customer support
Now that you are the proud owner of a Packt book, we have a number of things to help you to get the most from your purchase.
Downloading the example code
You can download the example code files for all Packt books you have purchased from your account at http://www.packtpub.com. If you purchased this book elsewhere, you can visit http://www.packtpub.com/support and register to have the files e-mailed directly to you.
All the projects or source code for this book are available in the GitHub repository. You can download it from the following link:
https://github.com/sudheerj/Learning-Primefaces-Extension-Development
Errata
Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you find a mistake in one of our books—maybe a mistake in the text or the code—we would be grateful if you would report this to us. By doing so, you can save other readers from frustration and help us improve subsequent versions of this book. If you find any errata, please report them by visiting http://www.packtpub.com/submit-errata, selecting your book, clicking on the errata submission form link, and entering the details of your errata. Once your errata are verified, your submission will be accepted and the errata will be uploaded on our website, or added to any list of existing errata, under the Errata section of that title. Any existing errata can be viewed by selecting your title from http://www.packtpub.com/support.
Piracy
Piracy of copyright material on the Internet is an ongoing problem across all media. At Packt, we take the protection of our copyright and licenses very seriously. If you come across any illegal copies of our works, in any form, on the Internet, please provide us with the location address or website name immediately so that we can pursue a remedy.
Please contact us at <copyright@packtpub.com>
with a link to the suspected pirated material.
We appreciate your help in protecting our authors, and our ability to bring you valuable content.
Questions
You can contact us at <questions@packtpub.com>
if you are having a problem with any aspect of the book, and we will do our best to address it.