We have completed testing the use of RichFaces in combination with Spring Faces and some special integration support has been added and is available in the latest nightly snapshot of RC1.
A couple of minor things had to be tweaked in order to allow RichFaces to work on its own with the Web Flow JSF integration. Additionally, we've added a special RichFacesAjaxHandler class that can be configured as a property on your FlowController that will allow the RichFaces components to be used alongside the Spring Faces components in the same page. This is especially useful as certain features such as the popup support are natively handled by the Spring Javascript library used by the Spring Faces components.
Configuring the RichFacesAjaxHandler is simple:
One nice part of the integration is that you can continue to use the <render> tag in your flow definition to control which components are re-rendered in response to an Ajax request. Doing so just requires binding the reRender attribute of your RichFaces Ajax component to a special flow variable called flowRenderFragments. For example the "More Results" command link in the reviewHotels view of the Spring Travel sample app becomes:
So for those of you out there using RichFaces with Web Flow (especially those of you who were encountering problems), I encourage you to grab the latest nightly build of RC1 from the snapshots repo and give it a try and let us know if you encounter any further problems.
- Jeremy
A couple of minor things had to be tweaked in order to allow RichFaces to work on its own with the Web Flow JSF integration. Additionally, we've added a special RichFacesAjaxHandler class that can be configured as a property on your FlowController that will allow the RichFaces components to be used alongside the Spring Faces components in the same page. This is especially useful as certain features such as the popup support are natively handled by the Spring Javascript library used by the Spring Faces components.
Configuring the RichFacesAjaxHandler is simple:
Code:
<bean id="flowController" class="org.springframework.webflow.mvc.FlowController"> <constructor-arg ref="flowExecutor" /> <property name="ajaxHandler"> <bean class="org.springframework.faces.mvc.richfaces.RichFacesAjaxHandler"/> </property> </bean>
Code:
<a4j:commandLink id="nextPageLink" value="More Results" action="next" reRender="#{flowRenderFragments}" rendered="#{not empty hotels and hotels.rowCount == searchCriteria.pageSize}"/>
- Jeremy
Comment