Saturday, October 20, 2012

OmniFaces 1.2 is released!

Finally, OmniFaces 1.2 is released! Due to job, holiday and personal circumstances it took one month longer than initially planned. There are relatively a lot of minor but very useful additions, among others the ability to capture <h:outputFormat> result into an EL variable, so that it can be used in a component attribute such as title. The only real major addition is a new PartialViewContext, the OmniPartialViewContext.

This custom PartialViewContext adds the following enhancements to your JSF web application:

  1. Support for programmatically executing callback scripts in ajax response.
  2. Support for programmatically adding arguments to JavaScript scope in ajax response.
  3. Buffers the ajax response fully until buffer size regardless of flush calls and gently closes the XML tags in ajax response in case of exception during ajax render response.
  4. Fixes the no-feedback problem when a ViewExpiredException occurs during an ajax request on a page which is restricted by web.xml <security-constraint>.

Points 1 and 2 are to be achieved by the new Ajax utility class. Note that PrimeFaces indeed offers similar functionality in flavor of RequestContext, but that's thus not available when you are not using PrimeFaces.

Point 3 has the advantage that the entire ajax response can be resetted and replaced by the error page by FullAjaxExceptionHandler and that exceptions during rendering of ajax response can now be properly handled, in both Mojarra and MyFaces.

Point 4 has the advantage that the enduser will now really be redirected to the login page instead of getting no form of feedback at all. More detailed description of the problem and solution can be found in this question: ViewExpiredException not thrown on ajax request if JSF page is protected by j_security_check.

Here's a complete overview of all additions, changes and bugfixes in OmniFaces 1.2, see also What's new in OmniFaces 1.2? on the showcase application:

Added in OmniFaces 1.2

  • Character encoding filter
  • Resource handler which replaces resource URLs by CDN URLs
  • Ignore validation failures on submit
  • Store h:outputFormat result in a variable
  • Several of:format() shortcut EL functions to format strings in EL
  • New Ajax utility class to ease programmatically updating components, executing callback scripts and injecting variables in JS scope
  • New OmniPartialViewContext for the Ajax utility class, better exception handling during rendering of ajax response by FullAjaxExceptionHandler and the fix of no-feedback problem when the view is expired during ajax request on a restricted page
  • New multi field validators which validates if "ONLY ONE" or "ONE or NONE" of the given inputs has been filled out
  • New of:formatCurrency() and of:formatNumber() EL functions
  • New generic enum converter for use in UISelectMany components with List<Enum>
  • Some new utility methods in Faces and Components

Changed in OmniFaces 1.2

  • Support to render JS/CSS inline by CombinedResourceHandler
  • Changed generation of combined resource IDs by CombinedResourceHandler so that it's now reversible
  • Improved rendered attribute of o:treeNodeItem so that it can now also see o:tree var/varNode
  • Improved components attribute of multi field validators so that it's resolved relative to parent UINamingContainer instead of to parent UIForm
  • Improved multi field validators to recognize UISelectBoolean components as well
  • Improved FullAjaxExceptionHandler to better handle exceptions during ajax render response phase
  • Improved o:highlight to apply style class on associated labels as well

Bugfixed in OmniFaces 1.2

  • Serialization and state saving issues in o:cache
  • Broken behaviour in MyFaces when using null values in SelectItemsConverter
  • Removed accidently introduced Servlet 3.0 dependency in GzipResponseFilter and improved recognition of non-gzippable responses (content range, etc)
  • Broken behavior of ResetInputAjaxActionListener when both PrimeFaces and RichFaces is used in same webapp

Download statistics

We just wanted to add, OmniFaces 1.1 was far more often been downloaded through Maven than through the Google project page. On the Google project page, OmniFaces 1.1 was been downloaded 557 times since the release. However, through Maven, where the stats are unfortunately not publicly available, OmniFaces 1.1 was been downloaded 418 times in July, 496 times in August and 528 times in September. We don't have statistics for October yet (we guess 400~500 until today), but the total is already 1999 downloads. That's not bad, after all :)


Unknown said...

Amazing work! Thank you!

Daniel said...

Great news, been waiting for 1.2 rls !

Umoh said...

Genius! I like the fact that OmniFaces doesn't try to re-invent the wheel, but targets stuff that the visual guys like Primefaces and RichFaces don't really focus on.