Showing posts with label ajax. Show all posts
Showing posts with label ajax. Show all posts
[BUG] conversation ended, timed out or was processing another request
1 comments Posted by Rey Jexter Bumalay at 9:04 AMWhen using seam framework and ajax4jsf, there is a bug when trying to re render an area using aj4:poll. Here is my code:
<h:outputText id="currentDateTime" value="#{currentDatetime}" styleClass="dateTime">
<s:convertDateTime pattern="MMMM dd, yyyy - hh:mm:ss a"/>
</h:outputText>
<h:form>
<a4j:poll interval="1000" reRender="currentDateTime" eventsQueue="timerQueue"></a4j:poll>
</h:form>
The solution is not yet clear as some say they need to tweak the concurrent-request-timeout in components.xml and others say that you need to simply make sure that the ajax request is not aschronous by using the eventsQueue property. Although the idea worked for me, some knowledgeable people say that tweaking those things depends on app by app.
Here are some useful links:
http://sfwk.org/Community/ConversationEndedTimedOutOrWasProcessingAnotherRequest
http://docs.jboss.com/seam/2.0.1.GA/reference/en/html/conversations.html#d0e5208
Ajax4JSF is a library that easily adds ajax functionality to existing jsf components. As oppose to Icefaces which is a set of jsf components that already have built in ajax functionalities, Ajax4JSF offers a much flexible way to add ajax functionalities to jsf components. It offers refreshing of display without the need to refresh the entire form. On the downside, Ajax4JSF is harder to use for very complex jsf components.
Using Ajax4JSF in seam 2.0 is easy. Just remove the line in your faces-config.xml:
<view-handler>com.sun.facelets.FaceletViewHandler</view-handler>and add the following code on your web.xml just aboe the seam listener definition:
<context-param>You will also need to define the following on you xml schema:
<param-name>org.ajax4jsf.VIEW_HANDLERS</param-name>
<param-value>com.sun.facelets.FaceletViewHandler</param-value>
</context-param>
xmlns:a4j="https://ajax4jsf.dev.java.net/ajaxThe following code is an example of a simple clock functionality that updates its time by polling / reRendering the component. I didnt use a backing bean on this example:
<h:outputText id="currentDateTime" value="#{currentDatetime}" styleClass="dateTime">
<s:convertDateTime pattern="MMMM dd, yyyy - hh:mm:ss a"/>
</h:outputText>
<h:form>
<a4j:poll interval="1000" reRender="currentDateTime"></a4j:poll>
</h:form>
Subscribe to:
Posts (Atom)