4 Replies Latest reply on Apr 24, 2008 3:47 PM by eklam

    DataTable, FilterBy, Datascroller issue

    Gianfranco Zola Newbie

      Hi!

      I have a rich:dataTable with filterBy set on various columns. I have also attached a rich:dataScroller to the dataTable.
      My issue is, if I filter any column, the datascroller component is not updated, only after navigating to an other page.

      Is there any settings or workaround to get the datascroller automatically updated upon using the built in filter on the dataTable?

      Thanks in advance!

        • 1. Re: DataTable, FilterBy, Datascroller issue
          Nick Belaevski Master

          Hello,

          Unfortunately, we have none for now. Here is the issue for that: http://jira.jboss.com/jira/browse/RF-2815

          • 2. Re: DataTable, FilterBy, Datascroller issue
            Gianfranco Zola Newbie

            Hi!

            Thanks for the answer. Finally I've found a workaround. If I use custom filtering, then with this code I can rerender the scroller, wich than changes according to record count:

             <rich:column
             sortBy="#{ci.category}"
             filterMethod="#{installHandler.filterCategoryProc}"
             >
             <f:facet name="header">
             <h:outputText value="Category"></h:outputText>
             </f:facet>
             <h:outputText value="#{ci.category}"></h:outputText>
             <f:facet name="footer">
             <h:inputText
             id="cat_input"
             value="#{installHandler.filterCategory}"
             >
             <a4j:support
             event="onkeyup"
             reRender="selecteddevs, selecteddevs_scroller"
             ignoreDupResponses="true"
             requestDelay="700"
             ajaxSingle="true"
             focus="cat_input"
             />
             </h:inputText>
             </f:facet>
             </rich:column>
            


            One problem I still have: as you can see in the code the inputText is in the table footer. It is because if I place it in the table header, then the sortBy tag places a href also on my inputText control, and if I click in the inputText to enter some text the sorting will be executed.

            How can I solve this problem?

            Thanks!

            • 3. Re: DataTable, FilterBy, Datascroller issue
              Ilya Shaikovsky Master

              Add to your inputText

              onclick="Event.stop(event);"


              And you will be able use it in header without sorting effect while clicking over input.

              • 4. Re: DataTable, FilterBy, Datascroller issue
                eklam Newbie

                I tried something like this, but I couldn't make it work...

                Here is my code, where should I use the a4j:support ?

                PS: The f:param, with the id, inside commandLink is a workaround I found to the getRowData issue, I process it my bean

                <rich:dataTable
                 styleClass="listagem"
                 width="200" id="dataTableList" rows="8" columnClasses="col"
                 value="#{relatorioComercialMB.list}" var="item">
                 <f:facet name="header">
                 <rich:columnGroup>
                 <rich:column headerClass="text-align:left; width: 30%;">
                 <h:outputText styleClass="headerText" value=""/>
                 </rich:column>
                 <rich:column headerClass="text-align:left; width: 30%;">
                 <h:outputText styleClass="headerText" value="TÃtulo"/>
                 </rich:column>
                 <rich:column headerClass="text-align:left; width: 30%;">
                 <h:outputText styleClass="headerText" value="Data"/>
                 </rich:column>
                 </rich:columnGroup>
                 </f:facet>
                 <rich:column>
                 <f:facet name="header">
                 <h:outputText value="Filtro"/>
                 </f:facet>
                 <h:commandLink action="#{relatorioComercialMB.editar}">
                 <f:param name="idSelecionado" value="#{item.id}"/>
                 <h:graphicImage value="../../images/bt_editar.gif"/>
                 </h:commandLink>
                 <h:commandLink action="#{relatorioComercialMB.remover}">
                 <f:param name="idSelecionado" value="#{item.id}"/>
                 <h:graphicImage value="../../images/bt_excluir.gif"/>
                 </h:commandLink>
                 </rich:column>
                 <rich:column filterBy="#{item.titulo}" filterEvent="onkeyup">
                 <h:outputText id="titulo" value="#{item.titulo}"/>
                 </rich:column>
                 <rich:column filterBy="#{item.data}" filterEvent="onkeyup">
                 <h:outputText id="data" value="#{item.data}"/>
                 </rich:column>
                 </rich:dataTable>
                 <rich:datascroller styleClass="listagem" id="dScroller" align="center" for="dataTableList" maxPages="10" />