Archive for the 'RichFaces' Category

4-part RichFaces 3 webinar series, slides and recordings

RichFaces 3 webinar series with slides and actual webinar recordings (at the end of this post).

Read more »

What RichFaces a4j:ajax adds on top JSF 2 f:ajax tag

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).

Attribute f:ajax a4j:ajax
event Works the same Works the same
execute @all
@this
@form
@none
Id’s
EL
@all
@this
@form
@none
Id’s
EL (different behavior, id’s are resolved in current request)
@region (when a4j:region is used)
render @all
@this
@form
@none
Id’s
EL
@all
@this
@form
@none
Id’s
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
onbegin n/a JavaScript to execute before Ajax request
onbeforedomupdate n/a JavaScript to execute after response comes back but before DOM update
oncomplete n/a JavaScript to execute after DOM update
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)

RichFaces 3 to RichFaces 4

RichFaces 4 is not only JSF 2 based, but also undergoing a major upgrade on the framework level. Many components are being rewritten to increase performance, reduce markup size, and make them consistent across the board. RichFaces 4 is a major upgrade and brings many improvements:

  • All JavaScript is now based on jQuery
  • Ajax framework improvements extending the JSF 2 specification
  • Component review for consistency, usability, and redesign following semantic HTML principles
  • Both server-side and client-side performance optimization
  • Strict code clean-up and review
  • New and easy to use CDK (Component Development Kit)

Although core Ajax concepts are staying the same, RichFaces 4 brings many new changes because it is now based on JSF 2. RichFaces 4 adds many new features on top of JSF 2 through its advanced features, tags, customization, and flexibility. If you have been using RichFaces, this 1-day training will bring your team up to speed with everything new in RichFaces 4. If you have questions, please contact me at:

RichFaces workshop in Germany

I will be presenting and teaching a RichFaces workshop in Nuremberg, Germany during Herbstcampus conference, September 12 – September 15, 2010.

With the upcoming RichFaces 4 release, the workshop will cover RichFaces version 4. This is a great opportunity to learn standard JSF 2 Ajax features and how RichFaces 4 advanced features, tags, customization and richness add on top of JSF 2. RichFaces 4 is a major upgrade. A lot of core functionality is being rewritten to make RichFaces faster and better. Many components are being rewritten to make them simpler, perform faster and consistent across board.

Discount
Get 25% discount by using this URL. Alternatively, you can use this booking code: ceHioRcpiD.

RichFaces workshop (full day)
Sunday, September 12, 2010
More info >>

I also have two general sessions.

Ajax Applications with JSF and the two New RichFaces 4
Monday, September 13, 2010
More info >>

Enterprise Applications with JavaFX and Flamingo
Tuesday, September 14, 2010
More info >>

As a reminder, we are also doing a webinar on September 8, 2010:
Ajax Applications with JSF 2 and the New RichFaces 4
Register >>

Webinar: Ajax Applications with JSF 2 and the New RichFaces 4 – Sept 8, 2010

With the upcoming release of RichFaces 4, we are doing a webinar on new RichFaces 4. Register and learn what’s new in RichFaces 4.

When:
Wednesday, September 8, 2010 | 2pm EDT (GMT-4 New York) / 18:00 GMT / 8pm CEST (GMT+2 Paris)

Abstract:
RichFaces is a JSF framework with AJAX components (over 100), skins, themes, and a component development kit. Although JSF 2 now offers basic AJAX functionality (which was, in fact, greatly inspired by RichFaces), a broader rich component library is still needed to build most real-world JSF AJAX applications. This webinar will first cover JSF 2 AJAX features and then the extra value the new RichFaces 4 adds on top of JSF 2 through its advanced features, tags, customization, and flexibility. Whether you are new to using JSF for developing AJAX applications or you can already show your JSF battle scars, this webinar has something to offer to you.

RichFaces JavaScript interactions: invoking JavaScript before and after Ajax request

One of the unique features in RichFaces is its power and flexibility. If you don’t want or need to deal with JavaScript then you use controls such a4j:support, a4j:commandButton, a4j:commandLink, a4j:poll, and a4j:jsFunction to fire and Ajax request and perform partial page updates. On the other hand, if you need more flexibility or looking for more fine-grained control over what happens before and after an Ajax request, RichFaces offers such feature. The feature is usually referred to as JavaScript interactions and allows you to tap into the Ajax request before and after the request.

There are three places where you can add or inject any custom JavaScript function:

Event Description
onsubmit, onclick On submit (just before request is fired)
onbeforedomupdate Response received, but before DOM update
oncomplete After DOM update

For following example has all three events defined (onsubmit, onbeforedomupdate, oncomplete):

<h:selectOneMenu value="#{bean.text}">
   <f:selectItem itemValue="United States" itemLabel="United States"/>
   <f:selectItem itemValue="Australia" itemLabel="Australia"/>
   <f:selectItem itemValue="United Kingdom" itemLabel="United Kingdom"/>
      <a4j:support event="onchange" reRender="text"
          onsubmit="if(!confirm('Are you sure you want change the country?')) 
		      {form.reset(); return false;};"
          oncomplete="alert('Country changed. We told you so.')"
          onbeforedomupdate="alert('Just before DOM update')"/>
</h:selectOneMenu>
 
<h:outputText value=”Current selection:”/>
<h:outputText id="text" value="#{bean.text}"/>

First you will see the message “Are you sure you want to change the country”?. You will then see “Just before DOM update”. At this point the response has come back but the DOM hasn’t been updated. Lastly, after the DOM has been updated you will see “We told you so”.

When using a4j:commandButton or a4j:commandLink, onclick attribute is used instead of onsubmit:

<a4j:commandButton value="Click" onclick="alert('hi');"/>

Complete summary of all tags and which attributes are supported:

Tag Attribute Descriptoin
a4j:commandButton, a4j:commandButton onclick:
JavaScript code to be invoked before Ajax request is sent.
a4j:support, a4j:poll onsubmit:
JavaScript code to be invoked before Ajax request is sent.
a4j:commandButton, a4j:commandLink,
a4j:support, a4j:poll, a4j:jsFunction
onbeforedomupdate:
JavaScript code to be invoked after response is received but before browser DOM update
oncomplete:
JavaScript code to be invoked after browser DOM update

This is a very powerful feature and allows you to invoke any JavaScript at three points during an Ajax request. Also, these are client-side events which means they are processed in the browser.

RichFaces 4.0.0 M1 is now available

The RichFaces team has released RichFaces 4.0.0 M1. You can read about this release from Jay Balunas.

A few other things:

  • To start quickly with RichFaces 4, download this template and replace original RichFaces Jar files with 4.0.0M1 version.
  • We are doing a webinar on RichFaces 4 and JSF 2 on September 8th, 2010. Details to follow.
  • To find all RichFaces how-to posts on my blog, click here (richfaces-howto tag).

Videos from JavaOne 2009

I knew these existed but somehow forgot to post them. These are videos of my presentations at JBoss booth at JavaOne 2009 in San Francisco. I think it would be more useful if the videos would switch more often to the slides I’m showing, but in case, enjoy!

RichFaces presentation
Part 1
Part 2
Part 3
Part 4

JavaFX with Seam presentation
Part 1
Part 2
Part 3

Using RichFaces queue to control traffic

Learn how to use RichFaces a4j:queue tag to control traffic to the server from my article published on JSFCentral.

Weekend reading list

Two greats posts by Felipe Wasserman (Exadel marketing intern):

RichFaces 4

Exadel Flamingo:

Next Page »