OmniFaces 1.5 has been released!
Along a bunch new EL functions, new tag attributes, new utility methods and new converters there are 2 new major additions: 1) specifying JSF and HTML code as output format parameter; 2) escapable faces messages, targeting multiple components for messages and markupless rendering of messages.
Specifying JSF and HTML code as output format parameter
You'll probably recognize yourself in this:
general.contact = contact us
some.paragraph = Please {1} for more information.
with
 value="#{text['some.paragraph']}" escape="false">
     value="#{request.contextPath}/contact.xhtml" />
     value="#{text['general.contact']}" />
   
The resource bundle file is polluted with HTML code. This is not very maintenance friendly and the translator responsible for translating and maintaining the bundle files probably doesn't know anything about HTML. Also, you as developer don't have the possibility to use the JSF , so you're forced to use a plain HTML  element (which doesn't understand JSF implicit navigation nor context root, so you've to specify the full URL as well).
With OmniFaces 1.5, the in OmniFaces 1.4 introduced , will have new support for JSF and HTML code as children. This way it's possible to achieve the following:
general.contact = contact us
some.paragraph = Please {0} for more information.
with
 value="#{text['some.paragraph']}" escape="false">
     outcome="contact" value="#{text['general.contact']}" /> 
 
Escapable faces messages, targeting multiple components for messages and markupless rendering of messages
The standard JSF  has been extended into  with the following new features:
- Possibility to specify multiple client IDs space separated in the for attribute.
 - Control HTML escaping by the new escape attribute.
 - Control iteration markup fully by the new var attribute which sets the current FacesMessage in the request scope and disables the default table/list rendering.
 
Particularly being able to use HTML in faces messages is a rather commonly seen/heard requirement. With the escape="false" it's now possible to use HTML in faces messages.
 escape="false" />
 Beware of XSS attack implications when you're about to inline user-controlled input in such a message!
An overview of all additions/changes/bugfixes in OmniFaces 1.5
Taken over from the What's new? page on showcase:
Added in OmniFaces 1.5
- Decode 
UIComponentchildren inwhen no value attribute is specified (so that you can specify JSF/HTML code as outputFormat parameter) - Allow endusers to specify custom passthrough attributes for 
Html5RenderKit - Added new 
includeRequestParamsattribute to which extendswith support for multiple client IDs in for attribute, ability to disable HTML escaping and ability to perform markupless rendering likeComponents#includeCompositeComponent()to programmatically include a composite component in given parent component- Add list based alternatives for the converters that automatically convert based on select items: 
omnifaces.ListIndexConverterandomnifaces.ListConverter - Message interpolator for Bean Validation that allows a component's label to be inserted in the middle of a message
 - New 
Faces#getRequestURLWithQueryString()which returns full request URL with query string - Added reset attribute to 
as an alternative for the programmatic resetting of a cache entry - Added converters for an 
IterabletoListandDataModel, so these can be used inand - New protected methods 
FullAjaxExceptionHandler#findExceptionRootCause()and#findErrorPageLocation()so that it can easier be subclassed - EL functions 
of:toJson(),of:replaceAll()andof:matches() 
Changed in OmniFaces 1.5
Obtain current component viaUIComponent#getCurrentComponent()when it's null inHtml5RenderKit(so that it also works with PrimeFaces input components which for some reason sendnullascomponentargument)- Improved 
CallbackPhaseListenerto support multiple callbacks instead of only one; the oldEvents#setCallbackXxx()methods are now deprecated - Support 
@all,@formand@thisinAjax#update() - Moved 
Faces#includeFacelet()toComponents#includeFacelet(); the old one is now deprecated 
Fixed in OmniFaces 1.5
- Add missing 
createResource()overrides to allResourceHandlers(so that it also works in combination with other resource handlers which don't usecreateResource(library, name)) - Normalize view ID in 
RestorableViewHandler(so that it also works when another suffix mapping is used than*.xhtml, this worked in 1.3 but broke in 1.4 (sorry!)) - Add missing support for 
noSelectionValueattribute inSelectItemsConverter - Action URL generation for FacesViews didn't take other view handlers into account, now it does (so that it also works with PrimeFaces 4.0 Dialog framework).
 
Maven download stats
Here are the Maven download stats:
- March 2013: 2137
 - April 2013: 1995
 - May 2013: 2089
 
Here's a screenshot of the graph at Maven central:
Source:http://balusc.blogspot.com/2013/06/omnifaces-15-is-released.html

Tidak ada komentar:
Posting Komentar