Monday, August 15, 2011

Editor for RichFaces 4.1

You have been requesting and we now answer: RichFaces gets pretty new Editor component, which was lacking from 4.0.0.Final release.

This component can be found in upcoming 4.1.0.Milestone1 release and is mostly feature complete with exception of skinning which will fit to rest of component suite - this functionality is targeted for Milestone 2.

Editor component is using CKEditor implementation internally and it is able to switch between two configurations of toolbar set: basic and full.



It also integrates nicely with rest of JSF 2, thus you can bind e.g. behavior for event denoting the editor content has been changed:

<rich:editor toolbar="full" value="#{article.text}">

<a4j:ajax event="change" action="#{article.save}" />
</rich:editor>

It is important to note that Editor uses resource handling servlet for obtaining own resources. You don’t require any additional configuration to set it up when working with Servlet 3.0 - everything will be registered automatically for you.

However in Servlet 2.5 and older environments, it is necessary to register this servlet manually in web.xml:

<servlet>

<servlet-name>Resource Servlet</servlet-name>
<servlet-class>org.richfaces.webapp.ResourceServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>

<servlet-mapping>
<servlet-name>Resource Servlet</servlet-name>
<url-pattern>/org.richfaces.resources/*</url-pattern>
</servlet-mapping>

I would appreciate your feedback on forums, how this component stands.

You can also watch what is being planned for future.