JSF 2 now has basic Ajax support via f:ajax tag. RichFaces 3 has a very popular a4j:support tag (in fact, f:ajax was inspired by a4j:support). RichFaces 4 comes with a4j:ajax which is based on f:ajax but upgrades the tag with more features and advanced functionality. The table below show the attributes available in both tags and how RichFaces upgrades the core Ajax functionality in JSF 2 (I’ll cover a4j:ajax extra attributes in the future).
In addition to a4j:ajax, RichFaces upgrades JSF 2 with tags such as a4j:commandButton, a4j:commandLink, a4j:poll, a4j:jsFunction, a4j:outputPanel and more (covered in future posts).
|event||Works the same||Works the same|
EL (different behavior, id’s are resolved in current request)
@region (when a4j:region is used)
EL (different behavior, id’s are resolved in current request)
|listener||Works the same||Works the same|
|onevent||Works the same||Works the same|
|onerror||Works the same||Works the same|
|immediate||Works the same||Works the same|
|disabled||Works the same||Works the same|
|bypassUpdates||n/a||Skips Update Model and Invoke Application phases, useful for form validation|
|limitRender||n/a||Skips all a4j:outputPanel ajaxRender=”true” areas. Only renders what is set in current render|
|status||n/a||Status to display during Ajax request|
|focus||n/a||Sets focus on component after Ajax request (not yet implemented)|
Starting with JSF 2? Check out my Learning JSF 2 series. A new article on using page parameters and page actions is coming up soon.
Check out this project, it’s very cool. dynaWidgets created by Top 21 GmbH, are a set of JSF components for rendering portlet like elements (called widgets) in your JSF application. The Ajax functionality is powered by RichFaces. Implementing widgets is just like implementing normal JSF facelets pages. Check out the examples section to see an example usage.
JSF 1.2 Components by Ian Hlavats.
Chapter 1: Standard JSF components
Chapter 1 starts by covering standard JSF UI components. It covers all the categories of standard components in JSF: input, output, selection, tables and layout. Examples are short, self-contained, and very easy to follow. Ian does an excellent job of describing various features and attributes of the components and their usage. His explanations are very easy to follow.
Chapter 1 summary says that it covered some of the key concepts behind JSF however, I didn’t see coverage of JSF managed beans, navigation, event listeners, and the JSF life cycle.
Chapter 2: Facelets
Chapter 2 covers Facelets and I think it’s the best Facelets coverage that I have seen. Good examples, easy to follow. I think all JSF 1.x books were published before Facelets became a de facto standard view technology, so this is the missing chapter for all of them. Chapter 2 starts with some interesting historical information on JSP and why Facelets was created. Again, excellent chapter and coverage of Facelets.
Chapter 3: MyFaces Tomahawk components
Chapter 3 covers MyFaces Tomahawk components. The chapters covers some of the most popular and interesting components in Tomahawk such as calendar, jsfCookMenu, upload file and tree. I was glad to see more backing bean code for some of the Tomahawk examples.
Chapter 4: MyFaces Trinidad
This chapter covers MyFaces Trinidad components. As with the standard JSF components and the MyFaces chapter, this is a general overview a description of the usage of some Trinidad components. Ian does a good job explaining how the components work and provides short examples. I like shorts examples because it’s easy for the reader to try them in his or her application without having go to through a large number of steps.
Chapter 5: IceFaces
There is not as much to say about chapter 5 which covers IceFaces JSF components. I would have liked to see some coverage of the IceFaces Direct-To-Dom approach, which really makes IceFaces different from libraries such as Trinidad and RichFaces.
Chapter 6: Seam
The Seam chapter starts with an introduction to Seam and why it was needed. It then goes on to explain Java EE and its components such as EJB3 and JPA. I think it’s a very good (brief) introduction for anyone who is just starting with Java EE. Then the chapter goes on to cover some of the Seam tags. Explanations are good and the examples are easy to follow. The first example shows how to delegate validation to the Hibernate Validator using Seam’s s:validate tag. Other tags are covered as well, such as s:label, s:span, and s:message.
The chapter them moves on to show how to add Ajax with the RichFaces a4j:support tag. (The actual RichFaces chapter comes after this chapter.) I think it would have been better to cover RichFaces, including a4j:support first, and then Seam.
The second part of the chapter is mostly dedicated to covering Seam conversation support. The chapter shows some good examples but feels a little bit out of place. I just don’t view the conversation as being part of the UI. There is also an example that puts navigation rules for controlling the conversation into a standard JSF descriptor file (faces-config.xml) instead of Seam’s descriptor file (pages.xml). Seam’s documentation recommends using only the pages.xml file for storing the navigation rules in a Seam application..
All in all though, it’s a good chapter on some of the core Seam features for JSF.
Chapter 7: RichFaces
The last chapter is on RichFaces and is the most interesting to me personally as I have myself published a book, Practical RichFaces on this subject. The chapter starts with a quick introduction to Ajax4jsf and RichFaces. This chapter is on par with the other chapters. It provides a high-level overview of some of the components from the rich: and a4j: tag libraries. Components covered include rich inputs, panels, menus, data iteration as well as Google Maps and Microsoft Virtual Earth. From the a4j: tag library, a4j:poll and a4j:commanLink are covered.
I was somewhat disappointed to not see a4j:support tag coverage here. (a4j:support was instead covered briefly in Seam chapter.) I think it’s one of the most important tags in the library and probably the tag that made the whole framework popular. Also, the f:ajax tag from JSF 2 is closely based in concept to a4j:support.
In general, the chapter is well written and provides some good examples of various RichFaces components and concepts.
First of all I want to congratulate Ian on this book. He did an amazing job. I personally know the time, dedication, and other resources need to write a book. The book provides a good, general overview of the most well-known third-party components as well as the standard JSF components. The examples are easy to follow and self-contained (which means it’s easy to run them) with explanations that are very clear.
My biggest question is who is the audience for this book? If you are just starting with JSF, then this book doesn’t go deep enough into the core features of JSF as well as the covered component libraries. You need at least a regular JSF book. If you are already an experienced JSF developer, then it could be a good read to quickly cover various 3rd party component libraries and see what’s available. But again, this is going to be your second book. If you are a manager, this could be a book you could read to get a high level overview of the various components in the JSF ecosystem.
Anyway, a great contribution by Ian Hlavats to the JSF community. Congratulations!
Congratulations to RichFaces team for releasing version 3.3.3. Although this version has basic JSF 2 support, if you are using JSF 1.2 you can upgrade to this version as it has the latest bug fixes and other improvements. With this release, the entire RichFaces team is now focused on pushing RichFaces 4.0 release out.
You can also check out Alex Smirnov’s (RichFaces architect, Exadel) post on portlet bridge support for this version and JSF 2.
Exadel Fiji extends JSF by allowing the use of Flex with JSF components and within a JSF page. It comes with ready-to-use charting components based on Flash as well as universal wrapper which allows to wrap any Flash component as JSF component.
We are working on Fiji version 2.0 which is going to be open source and also include a new tag to wrap any JavaFX applet as JSF component. We are going to host Fiji on exadel.org site. Work is still in progress but we have already made some changes to make it simpler for you to get involved. We now have a new Fiji forum on exadel.org (moved from Google Groups) and an issue tracker (Jira). This will enable you to request new features and enter any bugs you find. Once your register on exadel.org, you will be able to post on the forum and Jira.
Add BIRT Reporting to JSF Applications using RichFaces recording is available here. You can also download the complete application I showed during the webinar here.