JSF 1.2 Components

Ian Hlavats

eBook: $26.99
Formats: PDF, PacktLib, ePub and Mobi formats
$22.94 save 15%!
Print book: $44.99
$40.49 save 10%!
Print + eBook bundle: $71.98
Includes free access to the book on PacktLib
$63.43 save 12%!
Free Shipping! UK, US, Europe and selected countries in Asia.
This book can also be purchased from:
Overview
Table of Contents
The Author
Reviews
Downloads
  • Develop advanced Ajax-enabled JSF applications and solve common web development challenges using UI components from JSF component libraries
  • Master the basics of building web user interfaces with standard JSF HTML components
  • Implement UI security using JAAS and Apache Tomahawk components
  • Master a wide range of UI components and learn cutting-edge JSF development strategies with plenty of examples and screenshots 

Book Details

Language : English
Paperback : 408 pages [ 235mm x 191mm ]
Release Date : November 2009
ISBN : 1847197620
ISBN 13 : 978-1-847197-62-7
Author(s) : Ian Hlavats
Topics and Technologies : All Books, Java


Table of Contents

Preface
Chapter 1: Standard JSF Components
Chapter 2: Facelets Components
Chapter 3: Apache Tomahawk Components
Chapter 4: Apache Trinidad Components
Chapter 5: ICEfaces Components
Chapter 6: JBoss Seam Components
Chapter 7: JBoss RichFaces and Ajax4jsf Components
Appendix: Learning JSF: Next Steps
Index
  • Chapter 1: Standard JSF Components
    • An introduction to JSF
      • The Model-View-Controller architecture
      • Managed beans
      • The JSF Expression Language (JSF EL)
      • Converters and validators
    • Next steps
    • Getting input from the user
      • Rendering a text field
      • Rendering a text area
    • Form submission
      • Rendering a form
      • Rendering a button
      • Rendering a link
    • Rendering text
      • Rendering localized text
        • Registering a message bundle (JSF 1.1)
        • Registering a message bundle (JSF 1.2)
      • Rendering date/time information
      • Rendering parameterized text
      • Rendering labels
      • Rendering a validation message
      • Rendering all validation messages
    • Making selections
      • Rendering a checkbox
      • Rendering multiple checkboxes
      • Rendering radio buttons
      • Selecting one or selecting many values
      • Rendering a list of countries
      • Rendering a single-select list of options
      • Rendering a multiple-select list of options
    • Laying out components
      • Rendering a complex layout table
      • Rendering a table column
    • Displaying data
      • Rendering an HTML table
    • Summary
  • Chapter 2: Facelets Components
    • A brief history of Java web development
    • Comparing Facelets and JSP
    • Configuring a JSF application to use Facelets
      • Configuring web.xml
      • Configuring faces-config.xml
    • Getting started with Facelets
      • Hello World Facelets
    • Rendering debug information
    • Iterating data in a Facelets page
    • Removing UI components and markup
    • Including UI components and markup
      • Including a header and footer
        • Creating the header Facelet
        • Creating the footer Facelet
    • Passing parameters from one Facelet to another
    • Rendering a UI composition
      • Including a UI composition
      • Declaring a UI composition
    • Rendering a UI component
      • Including a UI component
      • Declaring a UI component
    • Creating a Facelets UI composition template
      • A simple Facelets template
        • A simple Facelets template client
        • Another simple Facelets template client
      • A more complex Facelets template
    • Decorating the user interface
      • Decorating content on a Facelets page
      • Creating a Facelets decoration
    • Rendering a UI fragment
    • An advanced Facelets composition template
    • Summary
  • Chapter 3: Apache Tomahawk Components
    • Validating user input
      • Validating e-mail addresses
      • Validating a phone number with a regular expression pattern
      • Validating that two fields have an equal value
    • Managing date and time selection
      • Selecting a date
      • Rendering a simple calendar
      • Rendering an appointment schedule
    • File management
      • Uploading a file
    • Working with trees
      • Creating a tree
      • Creating a tree column
      • Customizing the tree component
    • Navigation menus
      • Creating a navigation menu
      • Creating bookmarkable navigation menus
      • Populating a navigation menu
      • Generating dynamic navigation menus
      • Using the JSCookMenu component
    • User interface security
      • Configuring web.xml
      • Security-enabled components
      • Tomahawk SecurityContext EL extension
    • Displaying data
      • Rendering an unordered list
      • Rendering a definition list
      • Rendering a data table
        • Paginating a data table
        • Rendering a multi-column data table with a newspaper layout
    • Summary
  • Chapter 4: Apache Trinidad Components
    • What is Ajax?
    • Receiving input from the user
      • Rendering a color picker
      • Rendering a calendar
      • Rendering a number spinbox
      • Rendering a text field
      • Rendering a selectable list of values
    • Client-side conversion and validation
      • Enabling client-side validation in trinidad-config.xml
      • Validating one field at a time
    • Enabling Ajax functionality
      • Partial submit and partial triggers
      • Polling the server
      • Rendering a status indicator
      • Rendering a progress bar
    • Laying out components on the screen
      • Rendering a row layout
      • Rendering a complex table layout
      • Rendering a form layout
      • Rendering a panel group layout
    • Shuttling selections between lists
      • Rendering a multiple selection shuttle
      • Rendering an ordered shuttle
    • Working with tree and tree table components
      • Rendering a tree
      • Rendering a tree table
    • Creating navigation menus
      • Rendering a navigation tree
      • Rendering breadcrumbs
      • Rendering a multistep process (Train)
      • Rendering a process choice bar
    • Skinning and theme selection
      • Creating a new Trinidad skin
      • Implementing the skin's cascading style sheet
      • Rendering an icon
      • Customizing the Trinidad tree component's node icons
    • Implementing dialog windows
      • Declaring dialog navigation rules in faces-config.xml
      • Launching a dialog window
      • Returning a value from a dialog window
    • Summary
  • Chapter 5: ICEfaces Components
    • Receiving input from users
      • Rendering validation messages and text with effects
      • Receiving HTML input from users
      • Handling file uploads with ICEfaces
      • Rendering a calendar component
    • Creating navigation and pop-up menus
      • Creating a horizontal navigation menu with submenus
      • Rendering a vertical navigation menu with submenus
      • Adding menu separator items
      • Using context menus
    • Using tree components
      • Using the default tree node icons
      • Using custom tree node icons
    • Displaying data in tables
      • The ICEfaces data table component
      • Rendering dynamic columns
      • Implementing sortable column headers
      • Supporting resizable columns
      • Data table single row selection mode
      • Data table multiple row selection mode
      • Data table enhanced multiple row selection mode
      • Implementing data set paging
    • Rendering charts
      • Rendering a stacked bar chart
      • Rendering a 3-D pie chart
      • Rendering a bar chart
    • Laying out components with panels
      • Working with a border layout
      • Rearranging elements in a list
      • Rendering a series of components
      • Rendering collapsible panels
    • Creating a tabbed user interface
    • Working with modal dialogs
      • Rendering a simple modal dialog
      • Rendering a draggable dialog box
        • Rendering a draggable modal dialog
    • Summary
  • Chapter 6: JBoss Seam Components
    • Introducing the JBoss Seam framework
    • Java Enterprise Edition (Java EE) technology
      • Understanding Java SE and Java EE
        • Introducing Enterprise JavaBeans (EJB3) technology
        • Introducing Seam components
      • Introducing REST
    • Next steps
    • Validating user input with the Seam framework
    • Implementing JSF validation with Seam
      • JPA and the Hibernate Validator framework
    • Decorating the UI to improve form validation
    • Adding cutting-edge Ajax technology with Ajax4jsf
    • Displaying success messages in JSF
    • Seam conversation management
      • Temporary conversations
        • ShippingCalculatorBean.java
        • faces-config.xml
        • pages.xml
        • conversation01.jsf
        • conversation02.jsf
      • Starting a long-running conversation
        • Declaring navigation rules in faces-config.xml
        • Defining a long-running conversation in pages.xml
        • Implementing OrderBeanImpl.java
        • The introductory page of the order process
        • The customer registration screen (Step 1)
        • The shipping information screen (Step 2)
        • The order details confirmation screen (Step 3)
      • Concurrent conversations
    • Debugging Seam applications
    • Summary
  • Chapter 7: JBoss RichFaces and Ajax4jsf Components
    • Introducing JBoss RichFaces and Ajax4jsf
      • The JBoss RichFaces component library
      • The Ajax4jsf component library
    • Accepting user input
      • Rendering editable text
      • Rendering an in-place select component
      • Combining in-place input and select components
      • Rendering a slider component
      • Rendering a number spinner component
      • Rendering a calendar component
      • Rendering a color picker component
      • Rendering a combo box component
      • Rendering a suggestion box component with auto-complete
      • Rendering a pick list component
      • Rendering a rich text editor component
    • Using Ajax effectively
      • Understanding how Ajax4jsf works
      • Ajax-enabled form submission
      • Invoking an Ajax-enabled command link
      • Polling the server asynchronously
    • Panel components
      • Creating a basic panel
      • Rendering a panel bar
      • Rendering a panel menu
      • Rendering groups of menu items
      • Rendering a tabbed user interface
      • Rendering a toggle panel
    • Displaying data
      • Rendering a data table
      • Rendering a data table with a header, footer, and caption
      • Implementing sortable data table column headers
      • Filtering rows in a data table
      • Rendering a data grid
      • Adding a data scroller
      • Customizing the data scroller
      • Rendering an ordered list
      • Customizing an ordered list
      • Rendering a data definition list
    • Using special components
      • Rendering a Google Maps object
      • Rendering a Microsoft Virtual Earth object
    • Summary
  • Appendix: Learning JSF: Next Steps
    • JSF 2.0
      • New JSF annotations added to ease configuration
      • Simplified navigation mapping convention
        • JSF 1.x Navigation Mapping
        • JSF 2.0 Navigation Mapping
      • A Web resource loading mechanism for images, stylesheets, JavaScript files, and so on
      • Facelets is now integrated in JSF 2.0
      • The new "composite" JSF tag library for creating composite components
      • Built-in support for adding Ajax capabilities to UI components with <f:ajax>
    • The PrimeFaces component library
    • Next steps

Ian Hlavats

Ian Hlavats is an experienced Java developer, architect, consultant, and instructor specializing in JavaServer Faces (JSF). He has successfully designed, implemented, and released many JSF applications. One of his accomplishments is the creation of JSFToolbox for Dreamweaver, a suite of JSF UI development tools, which is now used by Fortune 500 companies and government agencies worldwide.

Ian has been teaching Java programming at the college level and in corporate training environments for several years. Ian was an invited speaker at the JSFOne conference in 2008 where he delivered a presentation on building JSF applications alongside a panel of other JSF industry experts. Ian was also invited to deliver presentations on hands-on JSF design and development using JSF tools such as Eclipse, NetBeans, and Adobe Dreamweaver at the JSF Summit conference in Orlando, Florida in December 2009. Ian has been working professionally as a Java consultant and Java instructor since 2003. His first project was an internal audit project tracking system for the Government of Canada that was implemented using the Struts, Spring, and Hibernate frameworks, and a MySQL database.

After working extensively with Struts, Ian became very interested in JSF since it solved many issues that Struts did not address. Ian's involvement in the JSF community began around 2005 when he was active on JSF mailing lists, providing feedback and submitting bug reports to the JSF and Facelets development teams. While Ian was employed in the Government, he was also teaching Java courses at the Algonquin College in Ottawa.

Ian left his permanent job in the Government in 2006 to work for his own company, Tarantula Consulting Inc., and pursued Java development contracts with high tech startups and small businesses in the Ottawa area. He worked extensively with JSF and in the process he developed a suite of JSF extensions for Adobe Dreamweaver.

JSFToolbox for Dreamweaver was released in 2006 and has since expanded its support for JSF to include new extensions for Facelets, Apache Tomahawk, Apache Trinidad, ICEfaces, JBoss Seam, and JBoss RichFaces/Ajax4jsf. From 2007 to 2008, Ian worked as a Java instructor delivering Java training to software architects, engineers, and managers at Cognos/IBM. During this time, he also won a contract to consult on an enterprise Java application for the Government of Canada. Ian conducted an architectural assessment of an existing Java EE application, performed extensive code review, interviewed staff, coordinated with other consultants, prepared a report, implemented his recommendations to improve the Java application architecture, and trained Java development staff. Tarantula Consulting continues to work on JSF projects for high tech startup companies in Canada and the US. In his spare time, Ian enjoys playing flamenco guitar and taking road trips on a Harley-Davidson motorcycle.

Ian is currently working on a second book on writing custom JSF components.

Sample chapters

You can view our sample chapters and prefaces of this title on PacktLib or download sample chapters in PDF format.

Find your book in our support section to find errata and to download code samples.

What you will learn from this book

  • Develop a database-enabled Java EE application using JSF, Enterprise JavaBeans™ (EJB3), the Java Persistence API (JPA), and the JBoss Seam framework
  • Send data from a modal dialog window to a JSF page using the Apache Trinidad dialog framework
  • Render pie charts, bar graphs, and line graphs using the Apache Trinidad and ICEfaces charting components
  • Write custom converters and validators, declare them in faces-config.xml, and register them on other UI components with the standard JSF Core tag library
  • Use standard JavaServer Faces components to implement a number of common web development tasks, such as rendering forms containing simple UI components and accepting and validating input from uses
  • Enhance presentation tier development in a JSF application using the Facelets view definition framework
  • Display a Microsoft Outlook style appointment schedule using the Apache Tomahawk schedule component
  • Implement user interface security with the Java Authentication and Authorization Service (JAAS) and Apache Tomahawk components
  • Add sophisticated Ajax behavior such as visual effects and asynchronous polling to your user interfaces with the ICEfaces component library
  • Discover new and up-and-coming JSF component libraries, and gain a better understanding of the JSF ecosystem and technology road map[/list]

Special Offers

PacktLib gives you access to this and 600+ other titles with an annual or monthly subscription.

Annual subscription:

$220.00 per annum

Monthly subscription:

$21.99 per month

Special eBook Discount Offer

+ Buy this eBook with JBoss RichFaces 3.3 eBook and get 50% discount on both. Just enter jsf12cmp in the 'Promotion Code' field and click 'Update' during checkout. The discount will be applied.

 

In Detail

Special eBook Discount Offer

+

Buy 'JSF 1.2 Components' with 'JSF 2.0 Cookbook' and get 50% off both the eBooks. Just add both the eBooks to your shopping cart and enter 'djsfebk' in the 'Enter Promotion Code' field. Click 'Add Promoitonal Code'  and the discount will be applied.

Today's web developers need powerful tools to deliver richer, faster, and smoother web experiences. JavaServer Faces includes powerful, feature-rich, Ajax-enabled UI components that provide all the functionality needed to build web applications in a Web 2.0 world. It's the perfect way to build rich, interactive, and "Web 2.0-style" Java web apps.

This book provides a comprehensive introduction to the most popular JSF components available today and demonstrate step-by-step how to build increasingly sophisticated JSF user interfaces with standard JSF, Facelets, Apache Tomahawk/Trinidad, ICEfaces, JBoss Seam, JBoss RichFaces/Ajax4jsf, and JSF 2.0 components. JSF 1.2 Components is both an excellent starting point for new JSF developers, and a great reference and “how to” guide for experienced JSF professionals.

This book progresses logically from an introduction to standard JSF HTML, and JSF Core components to advanced JSF UI development. As you move through the book, you will learn how to build composite views using Facelets tags, implement common web development tasks using Tomahawk components, and add Ajax capabilities to your JSF user interface with ICEfaces components. You will also learn how to solve the complex web application development challenges with the JBoss Seam framework. At the end of the book, you will be introduced to the new and up-coming JSF component libraries that will provide a road map of the future JSF technologies.

A comprehensive guide to the most popular JavaServer Faces components available today that will show you how to develop advanced Ajax-enabled web applications with the JSF framework.

Approach

This book is a practical, hands-on guide to learning JavaServer Faces components based on a fictitious computer hardware e-commerce application.

It adopts an example-driven approach focused on solving common web application development tasks using a wide range of JSF components from today’s most popular JSF component libraries.
Each chapter covers a different JSF component library and includes dozens of examples complete with Java source code listings, JSF markup, screenshots, and developer tips.

Who this book is for

If you are a professional web application developer interested in learning JavaServer Faces having an intermediate to advanced level of Java programming experience and a good understanding of HTML, CSS, and JavaScript, this book is for you.

A working knowledge of Java classes, interfaces, annotations, and generics, Java Collections Framework, JavaBeans API, Java Database Connectivity (JDBC), Java Servlets/JSP, Java Authentication and Authorization Service (JAAS), Java Persistence API (JPA), Enterprise JavaBeans (EJB), the Apache Tomcat web container, the JBoss AS 4.2 application server is assumed. Experienced JSF professionals will also find this book useful as a quick reference and “how to” guide.

Are there no books available that are right for you at the moment? How about signing up to our newsletter to keep up to date?
Awards Voting Nominations Previous Winners
Judges Open Source CMS Hall Of Fame CMS Most Promising Open Source Project Open Source E-Commerce Applications Open Source JavaScript Library Open Source Graphics Software
Resources
Open Source CMS Hall Of Fame CMS Most Promising Open Source Project Open Source E-Commerce Applications Open Source JavaScript Library Open Source Graphics Software
Sort A-Z