-
1. Re: Ajax4JSF experiences
theute Jul 17, 2006 5:33 AM (in response to gavin.king)I tried as well and got mixed experience.
I was able to do some stuff but not everything i wanted...
For instance i wanted to update the search result as i typed the searchString in the booking example.
It broke on s:link, if i removed them from the ajax region, then i have another problem: i have concurrent calls on the searchString of the Stateful Bean. By marking it stateless then i have the list correctly updated.
So yes there are several issues... -
2. Re: Ajax4JSF experiences
jabberwocky Jul 18, 2006 1:49 AM (in response to gavin.king)I've just make some tests with
Seam 1.0.1GA
ajax4jsf 1.0rc2
Facelets 1.1.11
It looks like working.
Echo Example:
#{bean} is Seam stateful EJB<ui:define name="body"> <a4j:status startText="Performing Request" startStyle="color:red" stopStyle="color:green" stopText="Request Done" for="region" /> <a4j:region selfRendered="true" id="region"> <h:form id="inputForm"> <h:outputText value="Type the Text:" /> <h:inputText value="#{bean.text}" size="50"> <a4j:support event="onkeyup" reRender="repeater,repeater2" /> </h:inputText> </h:form> <h:form id="outputForm"> <h:outputText value="Text in the AJAX Response:" /> <h:outputText id="repeater" value="#{bean.text}" /> <h:inputText id="repeater2" value="#{bean.text}" /> </h:form> </a4j:region> </ui:define>
Another test with <h:inputText> and AJAX reRendered <h:dataTable> is also working.
Here is my web.xml<?xml version="1.0" encoding="utf-8"?> <web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"> <!-- ========Seam begin ========== --> <listener> <listener-class>org.jboss.seam.servlet.SeamListener</listener-class> </listener> <!-- ========Seam end ========== --> <!-- ======== AJAX4JSF begin ========== --> <context-param> <param-name>org.ajax4jsf.VIEW_HANDLERS</param-name> <param-value>com.sun.facelets.FaceletViewHandler</param-value> </context-param> <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> <servlet-name>Faces Servlet</servlet-name> <dispatcher>REQUEST</dispatcher> <dispatcher>FORWARD</dispatcher> <dispatcher>INCLUDE</dispatcher> </filter-mapping> <!-- ======== AJAX4JSF end ========== --> <!-- ========Facelets begin ========== --> <context-param> <param-name>facelets.REFRESH_PERIOD</param-name> <param-value>2</param-value> </context-param> <context-param> <param-name>facelets.DEVELOPMENT</param-name> <param-value>true</param-value> </context-param> <context-param> <param-name>facelets.SKIP_COMMENTS</param-name> <param-value>true</param-value> </context-param> <!-- ========Facelets end ========== --> <!-- ======== JSF begin ========== --> <context-param> <param-name>javax.faces.STATE_SAVING_METHOD</param-name> <param-value>client</param-value> </context-param> <context-param> <param-name>javax.faces.DEFAULT_SUFFIX</param-name> <param-value>.xhtml</param-value> </context-param> <!-- Faces Servlet --> <servlet> <servlet-name>Faces Servlet</servlet-name> <servlet-class>javax.faces.webapp.FacesServlet</servlet-class> <load-on-startup>1</load-on-startup> </servlet> <!-- Faces Servlet Mapping --> <servlet-mapping> <servlet-name>Faces Servlet</servlet-name> <url-pattern>*.jsf</url-pattern> </servlet-mapping> <!-- MyFaces --> <listener> <listener-class>org.apache.myfaces.webapp.StartupServletContextListener</listener-class> </listener> <!-- ======== JSF end ========== --> </web-app>
in faces-config.xml just seam, facelets view-handler declared in web.xml<lifecycle> <phase-listener>org.jboss.seam.jsf.SeamExtendedManagedPersistencePhaseListener</phase-listener> </lifecycle>
But I've got another problem. In some time after AJAX request WARN on console like this:
08:16:55,580 WARN [TransactionImpl] Transaction TransactionImpl:XidImpl[FormatId=257, GlobalId=cam-79/754, BranchQual=, localId=754] timed out. status=STATUS_ACTIVE -
3. Re: Ajax4JSF experiences
ishabalov Jul 18, 2006 5:57 PM (in response to gavin.king)Gavin, you are always welcome to ask any questions! So far I do not hear any of it, did everything start working?
Seam is a bit unusual configuration for JSF developers (yet?), however I play with it a few weeks ago and find it very promising. I cannot tell that I fell in love with annotations, but more granular state management and process engine is something that I always appreciate. I still need to prove this on large project, to make my mind, but ? again ? I?d like to try.
I think we will review our compatibility status with Seam soon.
(3) must work. Something else is messing around, I believe.
I can predict the first question from Alex Smirnov ? what version of Ajax4jsf was used, we did several RC builds last weeks, situation may change significantly in just a few days.
Best,
Igor Shabalov. -
4. Re: Ajax4JSF experiences
gavin.king Jul 18, 2006 6:28 PM (in response to gavin.king)Hi Igor, thanks. When I get a chance, I want to get some closer discussions going on this topic.
My suspicion is that some of my problems relate to the MyFaces/AJAX4JSF combo, and some relate to problems b/w you servlet filter and my phaselistener.