Book Image

Primefaces Theme development

Book Image

Primefaces Theme development

Overview of this book

Developing stunning themes for web applications has never been easier! PrimeFaces delivers a powerful set of features that enables JSF developers to create and customize awesome themes on the web. It is very easy to use because it comes as a single JAR file and requires no mandatory XML configuration. With more than 30 out-of-the-box themes, jQuery integration, a mobile UI toolkit, Ajax Push technology, and much more, PrimeFaces takes JSF application development to a whole new level! This book is a hands-on example-rich guide to creating and customizing PrimeFaces themes using available tools. Beginning with creating a JSF project and integrating the PrimeFaces library, this book will introduce you to the features of theme components, how these are structured, and how PrimeFaces uses JQuery UI to apply a theme to your application. You will learn to examine and change the CSS rules and get creative by setting standard icons and adding new icons to them. You will use a combination of JavaScript and CSS to enhance your application with help of scheduler component and go on to adapt and package your custom theme so that it is compatible with the Resource Manager. Finally, you will explore PrimeFaces mobile apps, ensuring themes are compatible with your mobile applications best practices for theme design.
Table of Contents (18 chapters)
PrimeFaces Theme Development
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

The difference between standard JSF and PrimeFaces components


Standard JSF components such as h:inputText result in simple HTML being emitted into the page. To demonstrate what I mean, you need to perform the following steps:

  1. Create a JSF page in your project in a new folder called chapter2 and name the page difference.xhtml.

  2. To create the folder, right-click on the Web Pages folder in the Project navigator and move the mouse over the New item. Select the Folder option, name the folder chapter2, and click on Finish.

  3. Then, right-click on the chapter2 folder, move the mouse over the New item, and select JSF Page. Name the page difference and click on Finish.

Tip

NetBeans will add the appropriate file ending for you. So, if you type in difference.xhtml, the file will actually be named difference.xhtml.xhtml. So you don't need to add the extension explicitly.

We then add the following inside the h:body tag:

<h:form id="mainform">
  <h:panelGrid id="maintable" columns="2">
  <h:outputLabel...