views:

263

answers:

1

I have this seemingly-innocent code on my main JSF page:

<a4j:outputPanel id="sidebarContainer">
     <a4j:include viewId="#{UserSession.currentSidebar}"/>
</a4j:outputPanel>

Here is how the sidebar changes:

  1. A jsFunction calls a backing-bean method which sets the page (like "sidebar2.jsp") in UserSession

  2. The jsFunction has "rerender='sidebarContainer'", so that the correct page is loaded in the sidebar

When the web application is initially started in JBoss 5, when I call the jsFunction to change pages, sidebar2 appears, but the original sidebar (sidebar1.jsp) appears below it.

The sidebar switching works just fine after this initial wierdness. Any thoughts??

A: 

What seems to be the problem was that another AJAX request is happening at the same time that the AJAX request was called to change sidebars. We're putting in a few workarounds for now.

I noticed in the notes for RichFaces 4 alpha 2 that since RichFaces4 uses the JSF 2 f:ajax functionality, basically, AJAX requests are serialized so that only one can be underway at any given moment. So when we move to RichFaces 4 our problem should be solved.

Jon