Ajax4jsf + Trinidad, ajax4jsf removes all onclick values
wookets Jul 17, 2007 6:01 PMEnv:
- Ajax4jsf 1.1.1
- Facelets 1.1.13
- JSF 1.2.04-p02
- Trinidad 1.2.1
- a4j-trinidad.jar
I can get everything to work fine with this combination. However, once an ajax4jsf action happens on a page (say using the rich faces tabbed component in ajax mode or a4j:support), the ajax works perfect, but it clears all of the onclick values from the commandLinks. So, I can keep sending a4j requests and get responses, but any non-ajax action is not going through.
As far as I can tell, the commandLinks onclick attributes are changed from submitForm(xxx) to # (using the browser view source). I'm thinking this is actually a problem with the trinidad commandLink component, but I'm not sure...
I should note, trinidad works fine as long as I don't use ajax4jsf in the pages. Everything is also working if I remove the trinidad renderer and switch the view handler back. Of course, this means I'm left choosing between ajax4jsf and trinidad components. (I'm sticking with ajax4jsf, but hopefully there is a fix for this).
*As an aside. If I wrap my components with a4j:outputPanel and a4j:region or set the reRender attribute, it doesn't help at all. ajax4jsf still seems to update the whole page.
faces-config.xml
<default-render-kit-id>
org.apache.myfaces.trinidad.core
</default-render-kit-id>
web.xml
<!-- ************************************************************* -->
<!-- JSF config file locations + Params -->
<!-- ************************************************************* -->
<!-- Comments:
Should be a list (seperated by commas) which define the
location of all jsf context files. -->
<!-- ************************************************************* -->
<context-param>
<param-name>javax.faces.CONFIG_FILES</param-name>
<param-value>
/WEB-INF/navigation.xml
</param-value>
</context-param>
<context-param>
<param-name>javax.faces.STATE_SAVING_METHOD</param-name>
<param-value>client</param-value>
</context-param>
<context-param>
<param-name>org.apache.myfaces.trinidad.USE_APPLICATION_VIEW_CACHE</param-name>
<param-value>false</param-value>
</context-param>
<context-param>
<param-name>org.apache.myfaces.trinidad.CHECK_FILE_MODIFICATION</param-name>
<param-value>true</param-value>
</context-param>
<context-param>
<param-name>org.apache.myfaces.trinidad.resource.DEBUG</param-name>
<param-value>true</param-value>
</context-param>
<!-- Ajax4jsf and facelets integration -->
<!-- <context-param>
<param-name>org.ajax4jsf.VIEW_HANDLERS</param-name>
<param-value>com.sun.facelets.FaceletViewHandler</param-value>
</context-param> -->
<context-param>
<param-name>org.ajax4jsf.SKIN</param-name>
<param-value>DEFAULT</param-value>
</context-param>
<!-- trinidad alternative view handler -->
<context-param>
<param-name>org.apache.myfaces.trinidad.ALTERNATE_VIEW_HANDLER</param-name>
<param-value>com.sun.facelets.FaceletViewHandler</param-value>
</context-param>
<!-- ************************************************************* -->
<!-- Ajax4jsf filter -->
<!-- ************************************************************* -->
<!-- Note... you can use a FastFilter instead of the default for a faster ajax response. -->
<display-name>Ajax4jsf Filter</display-name>
<filter-name>ajax4jsf</filter-name>
<filter-class>org.ajax4jsf.Filter</filter-class>
<init-param>
<param-name>forceparser</param-name>
<param-value>false</param-value>
</init-param>
<filter-mapping>
<filter-name>ajax4jsf</filter-name>
<servlet-name>Faces Servlet</servlet-name>
<!-- <url-pattern>/*</url-pattern> -->
REQUEST
FORWARD
INCLUDE
</filter-mapping>
<!-- ************************************************************* -->
<!-- Trinidad Filter -->
<!-- ************************************************************* -->
<filter-name>trinidad</filter-name>
<filter-class>org.apache.myfaces.trinidad.webapp.TrinidadFilter</filter-class>
<filter-mapping>
<filter-name>trinidad</filter-name>
<servlet-name>Faces Servlet</servlet-name>
</filter-mapping>
<!-- ************************************************************* -->
<!-- Export filters -->
<!-- ************************************************************* -->
<!-- ************************************************************* -->
<!-- Faces Servlet -->
<!-- ************************************************************* -->
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup>1</load-on-startup>
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>*.jsf</url-pattern>
</servlet-mapping>
<!-- ************************************************************* -->
<!-- Trinidad Resources -->
<!-- ************************************************************* -->
<servlet-name>trinidadResources</servlet-name>
<servlet-class>org.apache.myfaces.trinidad.webapp.ResourceServlet</servlet-class>
<servlet-mapping>
<servlet-name>trinidadResources</servlet-name>
<url-pattern>/adf/*</url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file>index.html</welcome-file>
</welcome-file-list>