title: Ajax and Request Scoped beans in JSF 1.2 and Rich Faces
body: <p>I'm using JSF 1.2 and RichFaces 3.3, I have a page called NewsItemDetails with the following structure</p>
  
  <pre><code>&lt;h:form&gt;
    &lt;h:panelBar&gt;
      &lt;h:panelBarItem&gt;
        &lt;myTag:searchModule /&gt;
      &lt;/h:panelBarItem&gt;
    &lt;/h:panelBar&gt;
  &lt;/h:form&gt;
  </code></pre>
  
  <p>and the backing bean of that page is of a request scope, and here is a snippet of the faces-config.xml:</p>
  
  <pre><code>&lt;managed-bean&gt;
    &lt;managed-bean-name&gt;newsItemDetails&lt;/managed-bean-name&gt;
    &lt;managed-bean-class&gt;class.location...&lt;/managed-bean-class&gt;
    &lt;managed-bean-scope&gt;request&lt;/managed-bean-scope&gt;
    &lt;managed-property&gt;
       &lt;property-name&gt;id&lt;/property-name&gt;
       &lt;value&gt;#{param['id']}&lt;/value&gt;
    &lt;/managed-property&gt;
  &lt;/managed-bean&gt;
  </code></pre>
  
  <p>And to be complete here's a snippet of the searchModule tag:</p>
  
  <pre><code>&lt;ui:composition&gt;
     &lt;rich:tabPanel&gt;
       &lt;rich:tab label="Images"&gt;
         &lt;h:panelGrid columns="2"&gt;
           &lt;h:inputText value="#{newsItemDetails.searchLabel}" /&gt;
           &lt;a4j:commandButton value="Search" actionListener="#{newsItemDetails.onSearch}" reRender="mediaItemsSearchResults, imagesDataTable" /&gt;
         &lt;/h:panelGrid&gt;
  
         &lt;a4j:outputPanel id="mediaItemsSearchResults" ajaxRendered="true"&gt;
           &lt;rich:dataTable id="imagesDataTable" value="#{newsItemDetails.searchResults}" var="image"&gt;
             &lt;h:column&gt;
               &lt;h:outputText value="#{image.title}"/&gt;
             &lt;/h:column&gt;
           &lt;/rich:dataTable&gt;
         &lt;/a4j:outputPanel&gt;
  
       &lt;/rich:tab&gt;
     &lt;/rich:tabPanel&gt;
  &lt;/ui:composition&gt;
  </code></pre>
  
  <p>Now the problem is, whenever I hit the search button, the action listener is never called,
  but I could see a request sent to the server through Firebug. And here's the strange thing if I call the same searchModule tag, just outside the rich:panelBarItem and I hit the search button the action listener is called, but the dataTable is not re-rendered, and it's only called the first time I hit the button.</p>
  
  <p>So if anyone has a clue why this is happening, I would be more than grateful. </p>
  
  <p>Thanks in advance</p>