Release Notes‎ > ‎

OpenFaces 3.0 Release Notes

posted Nov 4, 2010, 8:24 AM by Unknown user   [ updated Nov 8, 2011, 7:13 AM by Dmitry Pikhulya ]

General Information

 

The main focus in this release is OpenFaces' compatibility with JSF 2.0 specification. No new features except JSF 2.0 compatibility are introduced in this release. The OpenFaces 3.x becomes the recommended version family for new development, however we will continue to evolve the JSF 1.2-based OpenFaces 2.x version family in parallel with OpenFaces 3.x family to support developers who cannot migrate to JSF 2.0 yet. All new features and components of the subsequent OpenFaces 3.x releases will also be included into the appropriate OpenFaces 2.x releases as well.

 

Adding OpenFaces 3.0

 

Installing OpenFaces into your application is as simple as follwing these two steps:

 

  • Make sure that your application uses the latest Mojarra 2.0.3, which is required for OpenFaces Ajax components to work properly. If you're using Glassfish v3 application server then you'll have to upgrade Mojarra in the server itself (see the Installing Mojarra 2.0.3 on Glassfish v3 section in Mojarra 2.0.3 release notes).
  • Add openfaces.jar found in the OpenFaces distribution package, and the dependency jars found in package's "lib" directory to your application.

 

Once you've done this, you can use OpenFaces in your application. Add this namespace declaration to your pages: xmlns:o="http://openfaces.org/"

 

Here's a code of a simplest page, which can be used to test that OpenFaces works properly in your application:

 

<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:o="http://openfaces.org/">
  <h:head>
    <title>OpenFaces Test</title>
  </h:head>
  <h:body>
    <h:form>
      <o:foldingPanel caption="Hello, OpenFaces!" expanded="false">
        <o:calendar/>
      </o:foldingPanel>
    </h:form>
  </h:body>
</html>

This page will display a collapsed FoldingPanel, like this:

... and clicking on the '+' expansion button will send an Ajax request and open the embedded Calendar like this:


If you require any further help, you can ask for assistance on the OpenFaces forum.

Migrating from OpenFaces 2.0

 

Assuming that you've migrated your application in general to JSF 2.0, the following steps are required to move to OpenFaces 3.0:

  • Make sure that your application uses the latest Mojarra 2.0.3, which is required for OpenFaces Ajax components to work properly. If you're using Glassfish v3 application server then you'll have to upgrade Mojarra in the server itself (see the Installing Mojarra 2.0.3 on Glassfish v3 section in Mojarra 2.0.3 release notes).
  • Upgrade openfaces.jar and the dependent library jars used in your application.
  • Remove OpenFaces resource filter declaration and mapping from application's web.xml file.
  • Review usages of <o:ajax> component and O$.ajax.request JavaScript function according to the information below.

 

Make sure to use the new JSF 2.0 <h:head> tag instead of <head>, which is important for proper resource handling of OpenFaces (and other) components.

 

NOTE: JSP support is discontinued in JSF 2.0, so you'll have to migrate to Facelets to use the new version of OpenFaces.

 

Changes in <o:ajax> component and O$.ajax.request function in OpenFaces 3.0

 

Some minor changes were made to the <o:ajax> component and O$.ajax.request JavaScript function to make their behavior uniform with the standard <f:ajax> tag and jsf.ajax.request function introduced in JSF 2.0, so you might amend their usage if you find them working not as you have expected after the migration:

  • The <o:ajax> component now doesn't automatically include its parent component (or the component to which it is attached to) into the list of submitted components (or the "execute" list). If you still need this behavior, you have to add that component to the execute attribute of<o:ajax> tag explicitly.
  • Rendered component(s) are also not automatically included into the list of submitted components, so you'll also have to include them explicitly if needed. This is applicable for both <o:ajax> tag and O$.ajax.request function.
  • The executeRenderedComponents attribute of <o:ajax> tag (which exists in early access builds of OpenFaces 2.1) has been removed in OpenFaces 3.0. This attribute is not needed anymore since, as mentioned in the previous point, rendered components are not included into the submitted (or "executed" components) anymore.

 

Code Contributions

 

OpenFaces is now using Git version control system, and its repository is published on GitHub. This makes it a lot easier to contribute code changes to OpenFaces because of GitHub's forking feature. So if you face any bugs, anticipate any features and feel that you can make appropriate changes, you're welcome to fork the project. See more details in this post. Of course, if you don't work with Git, good old patches are also accepted.

Comments