5 Replies Latest reply on Mar 5, 2010 12:22 PM by zjda

    rich:columns footer problem

    zjda

      Hi, I am using footer of rich:columns in rich:extendedDataTable to dispaly and edit filter:

       

                          <rich:columns value="#{childrenTable.propertyNames}" sortable="true"
                              sortBy="#{propName}" var="propName" index="index" id="column#{index}"
                              selfSorted="#{childrenTable.sortable[propName]}"
                              sortOrder="#{childrenTable.sortOrders[propName]}" label="#{propName}">
                              <f:facet name="header">
                                  <h:outputLabel value="#{propName}"/>
                              </f:facet>
                              <h:outputText value="#{row.map[propName]}" />

                              <f:facet name="footer">
                                  <a4j:region>
                                  <a4j:commandLink reRender="propertyFilterDialog"   
                                      value="#{childrenTable.filterMap[propName]}"
                                      oncomplete="Richfaces.showModalPanel('propertyFilterDialog', {width:300, height:350});">
                                          <f:setPropertyActionListener target="#{childrenTable.name}" value="#{propName}" />
                                  </a4j:commandLink>                           
                                  </a4j:region>
                              </f:facet>
                          </rich:columns>

      When I click the <a4j:commandLink> first time, it set the childrenTable.name and refresh propertyFilterDialog, which works as expected.  However, thereafter it does not set the property and refresh the dialog anymore.  If I change the footer to header, the code works fine. Is it by design or a bug for footer facet, or I did something wrong?

       

      thanks,

      -ZJ

        • 1. Re: rich:columns footer problem
          ilya_shaikovsky
          could you please provide sample in war(with java sources)? checked under simple test-apps with just column and controls and footer - seems works.
          • 2. Re: rich:columns footer problem
            zjda

            Hi Ilya,

             

            Thank you for looking at the issue.  I created a simple test code for you to reproduce the problem.  It includes a jsp file and a java class for the back bean as attached.  And you need to add the following config:

             

                <managed-bean>
                    <managed-bean-name>testTable</managed-bean-name>
                    <managed-bean-class>
                        test.ObjectTableModel
                    </managed-bean-class>
                    <managed-bean-scope>session</managed-bean-scope>
                </managed-bean>

             

            Set a break point inside the method setFilterName(String filterName) of ObjectTableModel.java, you will see that it will be called only once when clicking the links in the footer.

             

            I am using RF3.3.3-20091106.214036-25.  If you need more information, please let me know.

             

            Again, thank you very much.

            -ZJ

            • 3. Re: rich:columns footer problem
              zjda

              Hi Ilya,

               

              Are you able to reproduce the problem with my soure files?  I attach the war file in case you want it.  After you deploy the war file, you can point you browser to

               

              http://localhost:8080/rftest/faces/tableFooter.jsp

               

              It includes source files and uses richfaces 3.3.3.CR1.  First time when you click a link in the fotter, setFilterName(String filterName) in the back bean is called.  Then it is never called anymore unless you refresh the whole page.

               

              Please let me know if there is a solution/workaround.

               

              Thanks,

              -ZJ

              • 4. Re: rich:columns footer problem
                ilya_shaikovsky

                Define id explicitly for links. As columns recerated at every requests links has the other Id's after the first and you not rerender table so on next request action event just populated wrong. But re-render the table seems not a good solution so better to use :

                <a4j:commandLink id="link#{index}"

                 

                minor problems

                1) do not define Filter for RF twice.

                2) do not add two richfaces-impl jars. Use only one for jsf 1.2

                • 5. Re: rich:columns footer problem
                  zjda

                  Thanks, Ilya.

                   

                  It seems that I also need to remove the <a4j:region> around the <a4j:commandLink>.

                   

                  Again, your help is appreciated.

                  -ZJ