Category: RichFaces

RichFaces at JavaOne 2011 or What You Need for Building Cool Enterprise Applications with JSF

I'm speaking at JavaOne 2011

My session on What You Need for Building Cool Enterprise Applications with JSF was accepted for JavaOne 2011 conference in San Francisco.

Title:
What You Need for Building Cool Enterprise Applications with JSF
Time:
Tuesday, 10:30 AM, Hilton San Francisco – Golden Gate 3/4/5

JSF is the standard UI technology in Java EE, but on its own, it lacks tools for effectively building real-world rich enterprise applications. RichFaces 4, an open source extension for JSF, fills this development gap. RichFaces Core provides major enhancements for Ajax request customization, rendering and execution options, the JSF client queue, and more. RichFaces UI provides a large number of rich out-of-the-box components. RichFaces Skins makes it possible to change the look and feel of entire applications on the fly. The RichFacesComponent Development Kit streamlines building custom components.

This session explores these different aspects of RichFaces to see how each part, in turn, makes it easier to build cool enterprise JSF applications.

Hope to see you there!

Practical RichFaces book, 2nd edition is almost finished

You may have heard that Ilya Shaikovsky (@ilya_shaikovsky), RichFaces team member and I have been working on Practical RichFaces book 2nd edition. This edition covers the new RichFaces 4. The good news is that we are almost done (yes!). This is the final outline for the book. Expect the book to be available in mid August.

  1. The Basics
  2. Starting with RichFaces
  3. RichFaces core: a4j:tags, features and concepts
  4. RichFaces UI: Introduction to rich components
  5. Rich input components
  6. Rich output components
  7. Rich menu components
  8. Rich data iteration components
  9. Rich tree components
  10. Rich drag and drop
  11. Rich validation
  12. Rich components JavaScript API, client functions, and using jQuery
  13. RichFaces Skins
  14. RichFaces CDK: Building custom components
JAX/JSF Summit

Learn RichFaces 4 at JAX/JSF Summit in San Jose, CA June 20-23

The RichFaces 4 conference road trip continues. It started with TheServerSide Java Symposium in Las Vegan in March. Then it was CONFESS_2011 in Vienna in April and JAX 2011 in Mainz in May. Now RichFaces 4 comes to JAX and JSF Summit in San Jose, CA June 20-23. I will be doing a general RichFaces 4 session as well as a full day RichFaces 4 workshop. Jay Balunas from Red Hat is doing another RichFaces session called: RichFaces 4.0 Component Deep Dive . If you are in the Bay Area, you don’t want to miss this conference.

Ajax Applications with JSF 2 and New RichFaces 4
Monday, June 21, 2011
RichFaces is a JSF framework with Ajax components, client-side validation, cloud deployment, skins, and a component development kit (CDK). This session will briefly cover JSF2 Ajax features and then the extra value the new RichFaces adds on top of JSF2 through its advanced features. Examples will include partial table updates, Ajax queues, client-side validation, GAE deployment, and skins.

RichFaces 4 workshop
Sunday, June 20, 2011
Attendees will learn everything they need to begin developing applications with JSF 2 and RichFaces. We will first start with basic Ajax features in JSF 2 such as sending an AJAX request, partial view rendering, partial view processing using the f:ajax tag. We will then move to the new RichFaces 4 and demonstrate advanced features, tags, customization and richness it adds on top of JSF 2. You will learn how the a4j:ajax extends the standard f:ajax tag as well as how to use other a4j: tags, rich: tags and skins in RichFaces. Hands-on example will be used to demonstrate most concepts and features. Workshop will cover: standard JSF 2 Ajax features (f:ajax), a4j: tags, rich: tags, client-side validation, cloud deployment, Skins.

How to hightlight a field in JSF when validation fails

Highlighting an input field that failed validation (or conversation) is a common UI practice today. This sort of functionality is not available in JSF (nor RichFaces) out of the box (Seam does have it). I got an email from RichFaces 4 workshop attendee from CONFESS_2011 conference asking how to do it and I thought it’s a good idea to make it blog post. It turns out, implementing such functionality is pretty simple. All we need to do is check if a particular field (component) is valid and then render or not render a style for the input field.

Let’s start with the Java bean:

@ManagedBean
@RequestScoped
public class Bean implements Serializable {
 
   private String text; // getter and setter
 
   public boolean isInputValid (){
      FacesContext context = FacesContext.getCurrentInstance();
      UIInput input = (UIInput)context.getViewRoot().findComponent(":form:input");
      return input.isValid();
   }
}

Inside isInputValid, we are searching for a particular component and checking whether it’s valid or not.

JSF page:

<h:head>
<style>
.inputInvalid {
   border: 2px solid red;
}
</style>
</h:head>
<h:body>
   <h:form id="form">
      <h:panelGrid columns="2">
         <h:outputText value="Text:" />
	 <h:panelGroup id="inputGroup">
	    <h:inputText id="input" value="#{bean.text}" 
               styleClass="#{bean.inputValid?'':'inputInvalid'}" 
               required="true" requiredMessage="Value required">
		<a4j:ajax event="blur" render="inputGroup"/>
	    </h:inputText>
	    <h:message for="input" style="padding: 0.5em"/>
	 </h:panelGroup>
      </h:panelGrid>
   </h:form>
</h:body>

Everything important happens here:

styleClass="#{bean.inputValid?'':'inputInvalid'}"

If the component is invalid (validation has failed), then we will render inputInvalid CSS class. Otherwise, nothing is rendered.

This is the result when running the page (before invoking validation):

After validation:

As you can see the solution is pretty simple.

Presenting RichFaces 4, and mobile development choices at JAX 2011

In two weeks I will be at JAX 2011 in Mainz, Germany talking about the newRichFaces 4 and mobile development choices (Native Apps vs. Web Apps).

May 4, 17:30 – 18:30
Mobile Development Choices: Native Apps vs Web Apps

May 5, 10:15 – 11:15
Ajax Applications with JSF 2 and the New RichFaces 4

Say hello if you are there!