How-To

Step-by-step how-to guides and tutorials.

  • If you are learning RichFaces, here is one approach you can take. These are the core features that you need to know. Once you have a good grasp on them, you will be able to use any rich components from the library. This will probably surprise you, but there is not a whole lot to…

  • Some time ago I blogged on how to set focus on a component after an Ajax request in RichFaces. As a quick review, every tag that fires an Ajax request has focus attribute which points to the id of the component on which to set focus after the request. It works fine but only for…

  • The following are some of the best posts about RichFaces. Of course everything is good, but these important core features and other good examples: Easiest way to start with RichFaces (Eclipse template) RichFaces with Hibernate Validator RichFaces built-in client functions RichFaces region – partial JSF view processing View scope in RichFaces Using rich:layout and rich:layoutPanel…

  • Now that RichFaces 3.3.3 is out, plus JBoss Tools 3.1 was released in March, let me show you the easiest way to start with RichFaces and Tomcat 6. This doesn’t involve Maven. I’ll write a post about Maven and RichFaces some other time. The following steps assume you have JBoss Tools 3.0 or 3.1 installed.…

  • Did you ever need to know or display RichFaces version or revision when running your application? It’s rather easy to do. RichFaces registers VersionBean bean under a4j name which can give you that information. Output: Project name: Jboss Richfaces Vendor: richfaces.org Version: v.3.3.1.GA SVN $Revision: 14228 $ $Date: 2009-05-14 09:56:51 -0700 (Thu, 14 May 2009)…

  • I sometimes see developers use a4j:form tag (without any attributes) on their pages. When I ask them why did you use this tag? The answer is usually: “I thought I need this tag to send Ajax requests” It turns out you don’t have to use this tag to send an Ajax request. You can use…

  • I blogged earlier about four built-in RichFaces functions that come in very handy, especially the rich:component(id) one. Many rich components (from rich;* tag library) provide client-side JavaScript API. To access this API, you need to use rich:component(id) and add the JavaScript method name, such as: #{rich:component(‘id’)}.someMethod(). For example, go to rich:listShuttle component in RichFaces Developers…

  • It’s end of the day Friday (and end of they year), what’s a better time than to revisit one of the original RichFaces components: rich:suggestionbox. rich:suggestionbox shows a list of values in a pop-up based on the input provided. It has an action method that takes value from an input field. In that action, you…

  • With release of Java EE 6, you can now use Bean Validation with JSF 2. If you are using JSF 1.2 (and that’s probably still most of you), you can use Seam to take advantage of Hibernate Validator. If you are not using Seam but would still like to use Hibernate Validator, RichFaces provides such…

  • I have many posts on my blog that show various RichFaces features, how-to’s tricks and tips. It wasn’t as easy to find them so I went and tagged them all with richfaces-howto tag. Any time you want to see all these posts, just select richfaces-howto tag from the right-hand side bar.

  • RichFaces comes with four useful functions that make it simple to work with JavaScript. The functions are: #{rich:clientId(‘id’)} #{rich:element(‘id’)} #{rich:component(‘id’)} #{rich:findComponent(‘id’)} Suppose you have this on JSF page: #{rich:clientId(‘calendar’)} Placing this on JSF page: #{rich:clientId(‘calendar’)} will display the component client id: form:calendar #{rich:element(‘calendar’)} Placing this on JSF page: #{rich:element(‘calendar’)} is a reference to HTML element…

  • I attended David Geary’s talk on Killer Web Apps with JSF 2 Ajax at JSF Summit where he demonstrated Ajax features in JSF 2. As you start with JSF 2, you will notice that many Ajax features in JSF 2 are very similar to what RichFaces has been providing for a number of years now.…

  • This is a second post in Learning JSF 2 series. The first one on Managed Beans can be found here. Before I start, thanks to Nick Belaevski (RichFaces Team Lead – Exadel) for reviewing this posting. In JSF 1.2 all navigation rules are placed in JSF configuration file. Although you can still places navigation rules…

  • During my RichFaces session at JBoss World 2009, I showed three small examples of using Ajax with RichFaces 3.3, JSF 2, and RichFaces 4. I thougth it would be a good idea to show you the difference or more correct the similarities between the three. I will be blogging more about RichFaces 4 and JSF…

  • I’m starting a series called Learning JSF 2 on my blog. It will cover JSF 2 with emphasis on new features. Every post will cover a different features, the first one covers managed beans. Managed bean is a regular Java bean with a fancy name. When we register the bean with JSF it becomes a…

  • If you have been using JSF for a while, you know that in some instances, request scope is too short and session scope is too long to store objects. This of course applies to a situation where you need to keep some data for longer than a request but less than session. If you use…

  • Here is something you may or may not know. JSF Mojarra comes with a small extension tag library with three tags: regular expression validator, credit card validator, and focus setting tag. They are available since JSF version 1.2_09, but maybe even earlier (I didn’t check). Page setup Before using any of the tags, add this…

  • One of the new components in RichFaces 3.3.1 is rich:colorPicker. The component is based on jQuery widget and has the same functionality and events. Using the component is straight forward. Here is an example. JSF page: Initial rendering and opening the picker: After color selection:

  • RichFaces comes with a4j:status tag that allows to show AJAX request status. Here is an example how to create a page-level indicator, in other words, any action from this page will trigger the status to be displayed. It’s one way to tell the user that something is happening. Technically, the a4j:status is associated with the…

  • If you attended the webinar, you probably saw that skinning a standard button example wasn’t working (I used the internal browser in Eclipse). I ran the application in external browser (Firefox) and it worked fine. So, adding the following to web.xml: org.richfaces.CONTROL_SKINNING enable will skin all standard and HTML controls on a page. I will…

  • Tomorrow, June 16th at 14:00 is our fourth webinar on RichFaces. Tomorrow’s session will demonstrate how to use skins, build and extend skins, overwrite skin generated CSS and load different skins in runtime. More information and registration here.

  • RichFaces article on JavaLobby now has over 100,000 reads.

  • Another great post by Ilya Shaikovsky (Exadel) and RichFaces team member on displaying search results in multiple tabs.

  • Recording of RichFaces webinar this week. The topic was Rich UI components. Next webinar is June 16th and covers Skins. Register for it. We are planning more webinars, nothing is yet confirmed but possible topics are: RichFace UI components #2 (more advanced topics) RichFaces and Flex RichFaces and JSF 2.0

  • User registration solution using JBoss Seam with JSF / RichFaces and Hibernate User authentication / registration with JSF / RichFaces, Spring, and Hibernate Thanks to thelabdude for providing these excellent tutorials.