Book Image

PrimeFaces Blueprints

By : Sudheer Jonna, Ramkumar Pillai
Book Image

PrimeFaces Blueprints

By: Sudheer Jonna, Ramkumar Pillai

Overview of this book

<p>Through this book, you will gain practical experience in building web applications for a variety of business models. Starting with a basic application that will help you get acquainted with UI application development using PrimeFaces, you will learn about the significance of Ajax components. You will then be introduced to code compilation and generation in PrimeFaces. Following our first application, you will learn how to develop an employee registration application utilizing the form components of PrimeFaces. You will then learn how to use the layout and grouping components demonstrated through a POS application.</p> <p>Finally, you will discover how to build rich and interactive applications such as an online shopping cart, a movie portal, an e-commerce application, a news portal, an online chat messenger, and also a healthcare products application, each illustrating the intuitive components offered by PrimeFaces.</p>
Table of Contents (17 chapters)
PrimeFaces Blueprints
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

Preface

PrimeFaces is a leading lightweight open source user interface component library for JSF-based web applications. It provides a rich set of 100+ UI components with a single JAR, zero configuration, and no prerequisites. PrimeFaces aims to create built-in Ajax components that are based on standard JSF 2.0 Ajax APIs with a rich look and feel, with the help of a theming mechanism.

The initial development of PrimeFaces was started in 2008 by a Turkish JSF expert, Çağatay Çivici. Prior to developing PrimeFaces, he had been working on the YUI4JSF library. This experience of working with the YUI4JSF library allowed him to start developing PrimeFaces, which was initially based on the YUI JavaScript library. A few days later, the PrimeFaces team decided to replace this library with the powerful jQuery framework in order to create the component widgets.

This book will guide you through the process of creating a wide range of rich UI web applications based on successful, real-world business models. Each chapter comes with a custom web project, which you can build with a detailed, step-by-step procedure. This is accompanied by explanations of the key features used. By the end of each chapter, you will learn how to build specific, customized web applications using the PrimeFaces components. The projects inside this book make use of the latest versions of PrimeFaces (Version 5.0) and JSF (Version 2.2).

What this book covers

Chapter 1, Creating a "Hello World" Application, discusses how to create a simple "Hello World" PrimeFaces application in a step-by-step procedure and how to create the recommended PrimeFaces - supported environment (required software, browsers, IDE, tools, and so forth) that is required for real-world application development. A brief introduction to PrimeFaces and its role in UI applications will also be covered at the beginning of the chapter.

Chapter 2, Creating an Employee Registration Application, shows you how to create an employee registration application, which is an example of how to form components and their validations. The big set of PrimeFaces form components will be divided into two main categories, which are input components and select components, to create the registration type of the form filling application. These components and their validations that are used will also be explained in detail.

Chapter 3, Creating a Simple Restaurant Point of Sale Application, explains how to create a restaurant POS application with the help of the PrimeFaces layout and grouping components. These topics provide the templating mechanism needed for a fancy application, and each concept will be explained in detail.

Chapter 4, Global Mutual Funds Tracking, directs you on how to create a global mutual funds tracking application with the help of a data container and dialog components. This project emphasizes the usage of the data container and dialog components in order to maintain the big datasets in investment/financial schemes. The master-client and hierarchical data relationships (which are linked to these components) will also be well explained.

Chapter 5, Investor Information Analysis and Reporting, shows you how to create an investor information analysis application, which is useful because it is an example of data visualization and reporting components. Big datasets for reporting data will be analyzed in the form of charts and various formats of export features. The data visualization and reporting components used within this application will also be explained.

Chapter 6, Creating a Simple Online Shopping Cart Application, shows you how to create an online shopping cart application using the major menu variations and drag-and-drop components in PrimeFaces. This shopping cart application can be used to cover various products, such as electrical goods or household products.

Chapter 7, Creating an Online Video Portal Application, directs you on how to create an online movie portal application, which makes use of PrimeFaces multimedia, maps, and schedule components. This application can be used in the entertainment world and to book events that vary seasonally, such as special events in the summer or winter. Customers can pick the events that interest them and book them accordingly.

Chapter 8, Creating an Online Printing Station Application, guides you through how to build an online printing station application. This application handles all types of files using the PrimeFaces file upload and download components. This application will showcase a new concept that provides a platform to track, submit, and process printing jobs from multiple users across different locations.

Chapter 9, Creating an Online Chat Application, shows you how to create an online chat room application using the PrimePUSH. The PrimePUSH API deals with the asynchronous communication between the server and client using this chat room application. This chapter uses the simple social network application as our sample project.

Chapter 10, Creating a Healthcare Products Application, shows you how to create an online healthcare products application using common utility components and theming concepts (such as using built-in themes, customizing these, and creating new ones).

What you need for this book

As a reader of this book, you will need Java 5 or above and Maven installed on your machine, along with the JSF and PrimeFaces libraries. Optionally, you can use software and tools such as the Eclipse IDE, MySQL DB, and any browser tools to debug the application. You should also have a basic knowledge of JSF, PrimeFaces, and jQuery.

In order to run the customized web projects in this book, you need to store them on GitHub. This means that you can pull the source code at any time in order to have an efficient practical experience.

The software libraries or tools used in all of the customized projects of this book are listed as follows:

Who this book is for

This book is for anyone who wants to learn how to create customized PrimeFaces web applications. If you want to create a different set of categories for customized applications using PrimeFaces components, then this book is for you.

Conventions

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, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles are shown as follows: "These managed beans interact between XHTML/Facelets and the POJO class with the @ManagedBean annotation."

A block of code is set as follows:

<div id="header">
<ui:insert name="header">
  <ui:includesrc="/templates/common/header.xhtml" />
</ui:insert>
</div>

Any command-line input or output is written as follows:

mvn clean package

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: "Select the PrimeFaces component suite from the Components tab."

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 , and mention the book title through the subject of your message.

If there is a book that you need and would like to see us publish, please send us a note in the SUGGEST A TITLE form on www.packtpub.com or e-mail .

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.

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/support, 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 to our website, or added to any list of existing errata, under the Errata section of that title.

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 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 if you are having a problem with any aspect of the book, and we will do our best to address it.