2 Replies Latest reply on Jan 29, 2008 10:07 AM by lsabin

    richfaces datascroller and scope

    lsabin

      Hi.

      I have a problem with the richfaces datascroller. The use case is simple: based on the selection in a listbox the app shows a list of results.
      But the datascroller only works when my seam component (searchservice) is in the SESSION scope or if i create a long running conversation. In any other scopes the action (searchservice.searchCircuits) is not called when I click the buttons to paginate.

      Is this the way to use the datascroller or can it work with PAGE scopes?

       <h:panelGrid id="panel1" columns="3">
       <h:selectOneListbox id="combonodes" value="#{node}" size="1">
       <s:convertEntity/>
       <s:selectItems value="#{listNodes}" var="_node" label="#{_node.description}" noSelectionLabel="---"/>
       </h:selectOneListbox>
      
       <a:commandButton value="search" action="#{searchservice.searchCircuits(nodo.id)}"
       reRender="resultsPanel"/>
      
       </h:panelGrid>
      
       <h:panelGroup id="resultsPanel">
      
       <rich:datascroller ajaxSingle="false" align="left" for="tablacircuitos" maxPages="20" rendered="#{listCircuits.rowCount>10}" />
      
       <rich:dataTable id="tablacircuitos" rows="10" value="#{listCircuits}" var="_circuit">
      
      ...................
      


        • 1. Re: richfaces datascroller and scope
          mail.micke

          Hi,
          if you use any other scope than a long running conversation or session. On the next request after the clicking someting in the datascroller the data will be gone, due to how scopes work.

          And when clicking the datascroller your searchCircuits won't be called again in any case, since it is the outjected listCircuits which the table uses at its data source.

          If you really really don't want to use a long running conversation or the session, you can give the a4j:keepAlive component a try.

          cheers

          • 2. Re: richfaces datascroller and scope
            lsabin

            Thanks for your reply.

            What i don't understand is why the PAGE scope is not good for these cases. I was guessing that the datamodel would be created in the page context so the datascroller would have access to the data.