Ajax4JSF issues with MyFaces Ajax Components
November 28, 2006 12 Comments
I’ve posted an entry about how much I like AJAX4JSF some time ago but it turns out the lib causes issues with myfaces ajax components. I’ve not tried all of the ajax components we have but when the AJAX4JSF filter is configured in the application components like inputsuggestajax begin to fail.
Ajax4JSF filter is the cause of this, I haven’t digged what it does deeply but simply removing the filter config makes the myfaces components work again. Me and my buddy Yigit needed to use both ajax4jsf and myfaces ajax component together without any problems, so we came up with an interesting hack. In myfaces we generally use a request parameter called affectedAjaxComponent when making an ajax call with dojo, the idea is to disable ajax4jsf’s filter to intervene when there is a parameter with key affectedAjaxComponent in request parameter map. In order to apply the hack, we’ve checked out the code of ajax4jsf code from java.net, applied the hack and made our own quick fix build.
The hack works for us right now in our project but of course I’ll prefer ajax4jsf and myfaces ajax components work together without any hacks in general.
Solution: By setting forceparser to false, myfaces ajax components started working with Ajax4JSF. The config must be as follows;
Many thanks to Sergey Smirnov for this.