This content has been marked as final.
Show 5 replies
-
1. Re: Can't generate ajax call from JSF page
merlin-hst Aug 18, 2008 1:18 PM (in response to gbpanchal)I'm having the same problem but can't get it working even on a single page ;( But the sample I've found here seems to work: http://sezera.blogspot.com/2008/07/sample-springhibernatejsfrichfaces.html
My xhtml-site looks like:<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" xmlns:c="http://java.sun.com/jstl/core" xmlns:a="http://www.conergy.com/jsf" xmlns:ex="http://www.conergy.com/jsf/components" xmlns:rich="http://richfaces.org/rich" xmlns:a4j="http://richfaces.org/a4j"> <f:loadBundle basename="resources.resource" var="bundle"/> <head> ... </head> <body> ... <a4j:outputPanel ajaxRendered="true"> <a4j:log popup="true" id="log_pop" level="ALL" style="width: 800px; height: 300px;"></a4j:log> </a4j:outputPanel> <a4j:outputPanel ajaxRendered="true"> <h:messages globalOnly="false" errorClass="errorMessage" infoClass="infoMessage" /> <rich:messages /> </a4j:outputPanel> <a4j:region renderRegionOnly="true" id="inputGroup"> <h:panelGrid id="ajaxdemo" columns="2" border="0" columnClasses="panelc" > <h:inputText id="myInput" value="#{authorizationController.myTestProperty}"> <a4j:support id="myAjaxSupport" event="onkeyup" reRender="myOutput"></a4j:support> </h:inputText> <h:outputText id="myOutput" forceId="true" border="2" value="#{authorizationController.myTestProperty}"></h:outputText> </h:panelGrid> </a4j:region> </body> </html>
Tried it with the Sun JSF RI (Mojarra) and also MyFaces with different versions and browsers. I'm also using Spring and Hibernate.
Thanks, Lothar -
2. Re: Can't generate ajax call from JSF page
sergeysmirnov Aug 18, 2008 1:45 PM (in response to gbpanchal)I do not see the form on your page.
-
3. Re: Can't generate ajax call from JSF page
merlin-hst Aug 19, 2008 3:59 AM (in response to gbpanchal)You're right. I've tried to simplify the page but I've tried it before and now again with a surrounding h:form with no luck ;(
-
4. Re: Can't generate ajax call from JSF page
merlin-hst Aug 19, 2008 4:30 AM (in response to gbpanchal)Is there any known problem with Apache Tomahawk because I currently use it and can't remove it.
-
5. Re: Can't generate ajax call from JSF page
merlin-hst Aug 19, 2008 1:01 PM (in response to gbpanchal)After hours and days of searching I've found the (?) solution. If I add the following part to my web.xml it works perfect:
<filter> <display-name>Ajax4jsf Filter</display-name> <filter-name>ajax4jsf</filter-name> <filter-class>org.ajax4jsf.Filter</filter-class> </filter> <filter-mapping> <filter-name>ajax4jsf</filter-name> <url-pattern>/*</url-pattern> </filter-mapping>
Without it I get the described problems. Of course I have the rich faces filter defined.<filter> <display-name>RichFaces Filter</display-name> <filter-name>richfaces</filter-name> <filter-class>org.ajax4jsf.Filter</filter-class> </filter> <filter-mapping> <filter-name>richfaces</filter-name> <servlet-name>Faces Servlet</servlet-name> <dispatcher>REQUEST</dispatcher> <dispatcher>FORWARD</dispatcher> <dispatcher>INCLUDE</dispatcher> </filter-mapping>
And no matter if the following part is enabled or not<context-param> <param-name>org.ajax4jsf.VIEW_HANDLERS</param-name> <param-value>com.sun.facelets.FaceletViewHandler</param-value> </context-param>
So now it works but I don't now why ;)