Free Sample
+ Collection

PrimeFaces Cookbook

Mert Çalışkan, Oleg Varaksin

Here are over 100 recipes for PrimeFaces, the ultimate JSF framework. It’s a great practical introduction to leading-edge Java web development, taking you from the basics right through to writing custom components.
RRP $26.99
RRP $44.99
Print + eBook

Want this title & more?

$12.99 p/month

Subscribe to PacktLib

Enjoy full and instant access to over 2000 books and videos – you’ll find everything you need to stay ahead of the curve and make sure you can always get the job done.

Book Details

ISBN 139781849519281
Paperback328 pages

About This Book

  • The first PrimeFaces book that concentrates on practical approaches rather than the theoretical ones
  • Readers will gain all the PrimeFaces insights required to complete their JSF projects successfully
  • Written in a clear, comprehensible style and addresses a wide audience on modern, trend-setting Java/JEE web development

Who This Book Is For

This book is for you if you would like to learn modern Java web development based on PrimeFaces and are looking for a quick introduction into this matter. Prerequisites required for this book are basic JSF and jQuery skills.

Table of Contents

Chapter 1: Getting Started with PrimeFaces
Setting up and configuring the PrimeFaces library
AJAX basics with Process and Update
Internationalization (i18n) and Localization (L10n)
Improved resource ordering
PrimeFaces scaffolding with Spring Roo
Chapter 2: Theming Concept
Understanding the structural and skinning CSS
Installing themes
Customizing theme styles
Customizing default styles on input components
Adjusting the font and size throughout the web application
Why does the theme look different in Internet Explorer?
Simple ways to create a new theme
Default stateless theme switcher
Alternative stateful theme switchers
Chapter 3: Enhanced Inputs and Selects
Formatted input with inputMask
Auto suggestion with autoComplete
Usable features of inputTextArea
Discovering selectBooleanCheckbox and selectManyCheckbox
Basic and advanced calendar scenarios
Spinner – different ways to provide input
Slider – different ways to provide input
Rich text editing with editor
Advanced editing with in-place editor
Enhanced password input
Star-based rating input
Chapter 4: Grouping Content with Panels
Grouping content with a standard panel
Panel grid with colspan and rowspan support
Vertical stacked panels with accordion
Displaying overflowed content with scrollPanel
Working with a tabbed panel
Grouping of buttons and more with toolbar
Simulating the portal environment with dashboard
Creating complex layouts
Chapter 5: Data Iteration Components
Selecting rows in dataTable
Sorting and filtering data in dataTable
In-cell editing with dataTable
Conditional coloring in dataTable
Handling tons of data – LazyDataModel
Listing data with dataList
Listing data with pickList
Listing data with orderList
Visualizing data with tree
Visualizing data with treeTable
Exporting data in various formats
Visualizing data with carousel
Visualizing data with ring
Chapter 6: Endless Menu Variations
Static and dynamic positioned menus
Creating a programmatic menu
Context menu with nested items
Context menu integration
SlideMenu – menu in iPod style
TieredMenu – submenus in nested overlays
MegaMenu – multicolumn menu
PanelMenu – hybrid of accordion and tree
Accessing commands via Menubar
Displaying checkboxes in SelectCheckboxMenu
Dock menu for Mac OS fans
Chapter 7: Working with Files and Images
Basic, automatic, and multiple file upload
Uploading a file with drag-and-drop
Downloading files
Cropping images
Displaying a collection of images
Capturing images with photoCam
Comparing images
Chapter 8: Drag Me, Drop Me
Making a component draggable
Restricting dragging by axis, grid, and containment
Snapping to the edges of the nearest elements
Defining droppable targets
Restricting dropping by tolerance and acceptance
AJAX-enhanced drag-and-drop
Integrating drag-and-drop with data iteration components
Chapter 9: Creating Charts and Maps
Creating a line chart
Creating a bar chart
Creating a pie chart
Creating a bubble chart
Creating a donut (doughnut) chart
Creating a meter gauge chart
Creating an OHLC chart
Updating live data in charts with polling
Interacting with charts through AJAX
Creating dynamic image streaming programmatically
Mapping with Google Maps
Chapter 10: Miscellaneous, Advanced Use Cases
The power of the PrimeFaces selectors
Programmatic updating and scrolling with RequestContext
Two ways to trigger JavaScript execution
Adding AJAX callback parameters – validation within a dialog
Navigating to another page in AJAX calls
Polling – sending periodical AJAX requests
Blocking page pieces during long-running AJAX calls
Remembering current menu selection
Controlling form submission by DefaultCommand
Clever focus management in forms
Layout pitfalls with menus and dialogs
Targetable messages with severity levels
Leveraging Schedule's lazy loading feature

What You Will Learn

  • Learn basic concepts to be able to work with PrimeFaces.
  • Delve deep into 100+ rich UI components with all the required details
  • Get solutions to typical and advanced use cases
  • Use the best practices, avoid pitfalls, and get performance tips when working with the component suite
  • Gain know-how of writing custom components on basis of the PrimeFaces' core functionality
  • Meet additional components from the PrimeFaces Extensions

In Detail

PrimeFaces is the de facto standard in the Java web development. PrimeFaces is a lightweight library with one jar, zero-configuration, and no required dependencies. You just need to download PrimeFaces, add the primefaces-{version}.jar to your classpath and import the namespace to get started. This cookbook provides a head start by covering all the knowledge needed for working with PrimeFaces components in the real world.

"PrimeFaces Cookbook" covers over 100 effective recipes for PrimeFaces 3.x which is a leading component suite to boost JSF applications. The book’s range is wide‒ from AJAX basics, theming, and input components to advanced usage of datatable, menus, drag & drop, and charts. It also includes creating custom components and PrimeFaces Extensions.

You will start with the basic concepts such as installing PrimeFaces, configuring it, and writing a first simple page. You will learn PrimeFaces' theming concept and common inputs and selects components. After that more advanced components and use cases will be discussed. The topics covered are grouping content with panels, data iteration components, endless menu variations, working with files and images, using drag & drop, creating charts, and maps. The last chapters describe solutions for frequent, advanced scenarios and give answers on how to write custom components based on PrimeFaces and also show the community-driven open source project PrimeFaces Extension in action.


Read More