JSF 2 Fu

Source: Internet
Author: User
Tags new features glassfish

Of the many new features of JSF 2, the most compelling of the two features are controversial composite components and Ajax support. But the strength of their combination is obvious: it is easy to implement AJAX-enabled custom components.

About this series

The JSF Fu series is based on the concept of David Geary's introductory article with the same name. This series will delve into JSF 2 and its ecosystem, and will also explain how to integrate some Java EE technologies, such as contexts and Dependency injection, with JSF.

In this article, I'll show you how to implement the AutoComplete component, which will use Ajax to manage its completion list. In this process, you will learn how to integrate Ajax into your own composite component.

The code in this series is based on JSF 2, which runs in enterprise containers such as GlassFish or Resin. The last part of this article discusses in detail how to use GlassFish to install and run the code for this article.

JSF automatically completes custom components

The Automatic completion field (also known as the Suggestion Box), which is famous for Google search fields, is a combination of many Web applications. They are also typical applications of Ajax. AutoComplete fields are accompanied by a number of Ajax frameworks, such as scriptaculous and JQuery, such as the automated component integration of Figure 1-ajaxdaddy-as shown in:

Figure 1. Ajaxdaddy Auto-Complete components

This article discusses how to use JSF to implement an Ajax-enabled AutoComplete field. You'll see how to implement the AutoComplete field as shown in Figure 2, which will display a short list of virtual countries:

Figure 2. Auto Complete fields

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.