10 Replies Latest reply on Aug 17, 2009 7:09 PM by Flavio Henrique

    a4j:support not working with 3.3.2 (ok with 3.3.1/3.2.2). Re

    Flavio Henrique Newbie

      HI there!
      Testing my app with 3.3.2 I found a problem (maybe a regression?).
      I'm using:

      richfaces-api-3.3.2-20090808.042848-58.jar
      richfaces-impl-3.3.2-20090808.042848-58.jar
      richfaces-ui-3.3.2-20090808.042848-57.jar
      jsf 1.2_09

      I have an inputText that should be used to filter my dataTable, using filterExpression. The same code works with RF 3.3.1 and 3.2.2 but not with 3.3.2.

      With latest version my dataTable is not filtered (and I can't see the reRender working, but the dataBean is updated).

      Hope someone could spot something in my code.

      Thank you.

      <r:dataTable
       id="minhaTabela"
       value=""
       align="center"
       columns="6"
       styleClass="sembordas"
       width="100%">
      [...]
       <r:column
       styleClass="sembordas"
       colspan="3">
       <a4j:commandButton
       value="..."
       reRender="modalLocalizacoes"
       actionListener="#{ManterLocalizacao.consultarAction}"
       oncomplete="Richfaces.showModalPanel('modalLocalizacoes'); return false;" />
       <h:inputHidden
       id="localizacaoId"
       value="#{ManterCertificado.localizacaoId}" />
       <h:inputText
       size="35"
       id="localizacaoSigla"
       value="#{ManterCertificado.localizacaoSigla}">
       <a4j:support
       event="onkeyup"
       reRender="tabelaGUI, ds"
       ignoreDupResponses="true" />
       </h:inputText>
       </r:column>
      [...]
      


      My table that should be filtered:
      <r:dataTable
       value="#{ManterCertificado.lista}"
       var="item"
       sortMode="single"
       id="tabelaGUI"
       rows="9"
       width="100%"
       align="center">
      [...]
       <r:column
       rendered="false"
       filterExpression="#{fn:containsIgnoreCase(item.pessoa.localizacao.sigla, ManterCertificado.localizacaoSigla)}" />
      [...]
      </r:dataTable>
      <r:datascroller
       id="ds"
       renderIfSinglePage="false"
       for="tabelaGUI"
       maxPages="5">
      </r:datascroller>
      


        • 1. Re: a4j:support not working with 3.3.2 (ok with 3.3.1/3.2.2)
          Ilya Shaikovsky Master

          the richfaces-demo external filtering sample work for me on latest snapshot. maybe some application changes were also done between RF versions updates also?

          • 2. Re: a4j:support not working with 3.3.2 (ok with 3.3.1/3.2.2)
            Flavio Henrique Newbie

            Hi Ilya. Sorry the delay...
            There were no application changes between RF update...

            I made a new test right now (just to make 100% sure): using FF 2.5, Chrome 2 and IE6, using 3.3.2 do not work. Just changing the RF version to 3.3.1 or 3.2.2 the same code works...

            Any suggestion will be more than appreciated.

            Thank you.

            • 3. Re: a4j:support not working with 3.3.2 (ok with 3.3.1/3.2.2)
              Flavio Henrique Newbie

              The strange is that I have others fields that works with external filtering.

              This works with RF3.3.2:

              <r:columnGroup>
               <r:column styleClass="sembordas">
               <h:outputLabel value="#{msg.labelDataEmissao}" />
               </r:column>
               <r:column styleClass="sembordas">
               <r:calendar
               datePattern="dd/MM/yyyy"
               inputSize="8"
               reRender="tabelaGUI, ds"
               locale="#{ControleApp.locale}"
               id="dataEmissao"
               enableManualInput="true"
               converterMessage="#{msg.msgErroDataInvalida}"
               value="#{ManterCertificado.dataEmissao}">
               <a4j:support
               event="onkeyup"
               reRender="tabelaGUI, ds"
               ignoreDupResponses="true" />
               <a4j:support
               event="onchanged"
               reRender="tabelaGUI, ds"
               ignoreDupResponses="true" />
               </r:calendar>
               </r:column>
              [...]
              


              The filtering:
              <r:column
               style="text-align:center;"
               sortBy="#{item.dataEmissao}"
               filterExpression="#{ManterCertificado.dataEmissao == null || item.dataEmissao.time >= ManterCertificado.dataEmissao.time}"
               width="5%">
               <f:facet name="header">
               </f:facet>
               <h:outputText value="#{item.dataEmissao}">
               <f:convertDateTime pattern="dd/MM/yyyy" />
               </h:outputText>
              </r:column>
              


              • 4. Re: a4j:support not working with 3.3.2 (ok with 3.3.1/3.2.2)
                Nick Belaevski Master

                Hi,

                Does anything change if you remove

                rendered="false"
                from filtering column?

                • 5. Re: a4j:support not working with 3.3.2 (ok with 3.3.1/3.2.2)
                  Flavio Henrique Newbie

                   

                  "nbelaevski" wrote:
                  Hi,

                  Does anything change if you remove
                  rendered="false"
                  from filtering column?


                  Hi Nick,
                  in fact removing the rendered="false" tag the filter started to work.

                  is this the new behavior?

                  thank you.

                  • 6. Re: a4j:support not working with 3.3.2 (ok with 3.3.1/3.2.2)
                    Flavio Henrique Newbie

                    Nick, if this is the new behavior, can you suggest me a way to filter the table by data not displayed?
                    I tried visible="false" on column tag and the filter do not work.

                    Thank you.

                    • 7. Re: a4j:support not working with 3.3.2 (ok with 3.3.1/3.2.2)
                      Nick Belaevski Master

                      Yes, that's a new behavior introduced because of users claim that non-rendered components should not evaluate filter expression because of user code issues. The request is somewhere in project JIRA, I don't remember the exact number, sorry.

                      As a solution I can propose to set filter expression for any (e.g. first) visible column; in fact filtering is invariant to what data is shown in a particular column. Please let us know how this works for you.

                      • 8. Re: a4j:support not working with 3.3.2 (ok with 3.3.1/3.2.2)
                        Flavio Henrique Newbie

                         

                        "nbelaevski" wrote:

                        As a solution I can propose to set filter expression for any (e.g. first) visible column; in fact filtering is invariant to what data is shown in a particular column. Please let us know how this works for you.


                        Hmmm... in my case all visible columns are filtered already (by filterExpression or filterMethod), but the dataTable do not show all possible values (screen size / readable restrictions) that, by user demands, need to be filtered too. So I put some textFields/selectOneMenu outside the dataTable to work as filters for those values that are not visible.

                        For instance: I have a table with persons and I need to filter the table by some person's atribute. This atribute is not rendered/visible in the dataTable, but it's there (session) and the user needs to filter the table by this atribute.

                        I'm far away to be able to post anything against the behavior change decision, but IMHO if the user dont need to filter the data not displayed, dont use it in filterExpressions/filterMethod tags...

                        Any more thoughts? visible="false" shouldn't work? Or this property works as rendered="false"?

                        Thank you!

                        • 9. Re: a4j:support not working with 3.3.2 (ok with 3.3.1/3.2.2)
                          Nick Belaevski Master

                          By JSF conventions non-rendered components shouldn't be processed. It's a bug that they were processed before and now it's fixed. Please take into consideration that for people which program data tables with variable columns, it is more convenient to set rendered="#{someFalseValueNow}" than somehow remove method and value expressions that were defined in .xhtml page.

                          For your case - set several filter expressions for the first rendered column and include there filtering conditions for this column and for external inputs also.

                          • 10. Re: a4j:support not working with 3.3.2 (ok with 3.3.1/3.2.2)
                            Flavio Henrique Newbie

                             

                            "nbelaevski" wrote:

                            For your case - set several filter expressions for the first rendered column and include there filtering conditions for this column and for external inputs also.


                            Hmmmm... thank you Nick. It working now.

                            Now I understand what you meant with "in fact filtering is invariant to what data is shown in a particular column.".