Friday, June 1, 2012

OmniFaces 1.0 is released!

After a long time of collecting and developing helpful utility methods and components, taking benefit of lessons learnt during ages of professional JSF development, reading for frequently recurring peculiar JSF problems, finding reuseable solutions for those problems, testing everything on both Mojarra and MyFaces, working through reported issues, we, me and Arjan Tijms, can now proudly announce that OmniFaces 1.0 is ready for release!


The last major addition is the FacesViews feature, an idea of Arjan Tijms, which allows using extensionless URLs. Long story short, here's a link to the FacesViews guide and the showcase demo.

OmniFaces 1.0 Initial features

Here's an overview of what's all available in OmniFaces 1.0:

  • Conditional comment rendering for IE
  • Highlighting fields that failed validation
  • Executing scripts on load of every (ajax) response
  • OutputLabel automatically setting label of associated input component
  • Include Servlets and JSP pages in Facelets
  • Tree with full custom markup per level (useable for various recursive use cases)
  • Stateless view parameter
  • Automatic conversion of model objects in drop-downs and other select components.
  • Simplified PhaseListener requiring less boiler plate
  • Reset for input fields making them always updateable via ajax
  • Ajax aware exception handler
  • Extensionless URLs without need to register individual pages
  • Proper 404 for FacesFileNotFoundException
  • HttpFilter convenience class as analogy to HttpServlet
  • Collections of EL functions for dealing with arrays, conversion, dates and strings
  • Convenience managed beans for the current time and server startup time
  • Combining separate scripts and stylesheets to reduce HTTP requests
  • Render-time evaluation for f:converter and f:validator attributes
  • Passing a method expression into Facelets tag
  • Collection of Java methods for dealing with components, events, exceptions, messages and JSF in general
  • Checkbox with required attribute that works intuitively
  • Multi-field validators, for "all or none", "all equal", "one or more", "all in order" and "unique" validations

You can find demonstrations of practically everything on the showcase site.

This is not the end. We still have more ideas on our list, which we would like to implement in future versions. However, none of them are really trivial. For example, client+server side double submit prevention which handles responses properly, some sort of a session timeout checker, a component which makes it possible to invoke a bean action before unload, a component which caches the generated HTML output in the specified scope for a specified time, a component which simplifies usage of HTML5 localstorage feature from JSF on, some components which should simplify container managed login/logout in JSF, etcetera.


Unknown said...

Cool! :)
This project has quickly become very valuable for me: it not only has some very useful ideas, but it's also a showcase of great code for me to learn from it.
Thanks a lot!

Unknown said...

Hi Balus,

Thanks for your effort.

Is there any mechanism to handle ViewExpiredException when occured with ajax posts after session is timeouted?

Unknown said...

Ok, i saw FullAjaxExceptionHandler :)

Phuu Tek said...

The showcase demo seems to be down?

lleontop said...

Again great work!!

I use omnifaces 1.0 and i find it extremely helpful!

But i face a strange problem. In some of my pages i need to save something and after succesfull save (save is a seperate method in my managed bean called as you can imagine by a commandbutton) i use Messages.addFlashGlobalInfo and then a Faces.redirect. Everything works fine there a succesfull message is displayed as wanted.

But in one of my managed beans during the construction (simple constructor not PostConstruct annotation) i need to redirect user under certain conditions with a message and i use the same combination Messages.addFlashGlobalInfo and Faces.redirect. The redirect is ok, the "target" page has a messages component in it but no message is displayed. Is there something wrong with this logic redirecting from a constructor, is it a bug from omnifaces or is it something else?

I use Primefaces 3.3 (and primefaces messages component) and Mojarra 2.1.9.

Any help would be greatly appreciated!!!

BalusC said...

@lleontop: have you checked Messages#addFlash() javadoc? If redirect is on a different path, then flash won't work. This is Mojarra specific.

lleontop said...

@BalusC: As usual you are right! In my tests i redirected to a page in a completely different folder and also in another page within the same folder. In both the message was gone... I should rtfm first i guess. Didn't know that there where so many open issues with Mojarra Flash!! Thanks again BalusC!

kostja said...

Many thanks for making our lives better. You rock.