5 Replies Latest reply on Aug 19, 2007 4:44 PM by akira_ag

    rich:dataTable bug?

      Hi people!

      I bumt into issue with the datatable component. I has the following JSP-code:

      <rich:dataTable
       id="MyTable"
       value="MySessionBean.myCollection"
       var="item">
      
      <rich:column>
       <h:commandLink action="#{MySessionBean.goToId}">
       <f:param name="itemIdParam" value="#{item.id}"/>
       <h:outputText value="#{item.title}"/>
       </h:commandLink>
       ...
      </rich:dataTable>
      


      and for first view this page within session commandLink doesn't fire (refreshing page only)!! After the first unusable behavior this page work correctly later (within session).
      If change rich:dataTable to h:dataTable all ok.

      My Environment:
      GlassFish v58b (RC3) / JDK 6u2,
      RF v3.0.1 and 3.0.2 affected.
      Please help!


        • 1. Re: rich:dataTable bug?

          something around, not in the table.
          I hope you have value="#{MySessionBean.myCollection}" for the table.

          rich:dataTable has no 'rendered' attribute. Does on of the parent in the hierarchy has it?
          Are you sure all six phases are passed for the very first request?

          • 2. Re: rich:dataTable bug?

            I not see anything mistrustful around.
            I provide all code of test-case for RF:

            file: index.jsp:

            <?xml version='1.0' encoding='utf-8'?>
            <jsp:root xmlns="http://www.w3.org/1999/xhtml"
             xmlns:jsp="http://java.sun.com/JSP/Page" version="2.0"
             xmlns:f="http://java.sun.com/jsf/core"
             xmlns:h="http://java.sun.com/jsf/html"
             xmlns:a4j="https://ajax4jsf.dev.java.net/ajax"
             xmlns:rich="http://richfaces.ajax4jsf.org/rich">
             <f:view>
             <html>
             <jsp:output
             doctype-root-element="html"
             doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
             doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN"/>
             <jsp:directive.page contentType="text/html;charset=utf-8"/>
             <head>
             <title>Bug example / index</title>
             </head>
             <body>
             <h:form>
             <h:commandLink action="#{ MySessionBean.showDataTable }">Please, show my table</h:commandLink>
             </h:form>
             </body>
             </html>
             </f:view>
            </jsp:root>
            


            file: test-bug.jsp:
            <?xml version='1.0' encoding='utf-8'?>
            <jsp:root xmlns="http://www.w3.org/1999/xhtml"
             xmlns:jsp="http://java.sun.com/JSP/Page" version="2.0"
             xmlns:f="http://java.sun.com/jsf/core"
             xmlns:h="http://java.sun.com/jsf/html"
             xmlns:a4j="https://ajax4jsf.dev.java.net/ajax"
             xmlns:rich="http://richfaces.ajax4jsf.org/rich">
             <f:view>
             <html>
             <jsp:output
             doctype-root-element="html"
             doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
             doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN"/>
             <jsp:directive.page contentType="text/html;charset=utf-8"/>
             <head>
             <title>Bug example / datatable</title>
             </head>
             <body>
             <h:form>
             <rich:dataTable
             id="MyTable"
             value="#{MySessionBean.myCollection}"
             var="item">
             <rich:column>
             <h:commandLink action="#{MySessionBean.goToId}">
             <f:param name="itemIdParam" value="#{item.id}"/>
             <h:outputText value="#{item.id}"/>
             </h:commandLink>
             </rich:column>
             </rich:dataTable>
             </h:form>
             </body>
             </html>
             </f:view>
            </jsp:root>
            


            file: MySessionBean.java:
            package test.checkbugs;
            
            import java.util.Collection;
            import java.util.LinkedList;
            
            public class MySessionBean {
             public static class MyItem {
             private Integer id;
            
             public MyItem() {};
             public MyItem(Integer val) {
             this.id = val;
             };
            
             public void setId(Integer id) {
             this.id = id;
             }
            
             public Integer getId() {
             return id;
             }
             }
            
             private Collection<MyItem> myCollection;
            
             public String showDataTable() {
             setMyCollection(new LinkedList<MyItem> ());
             for(int i=0;i<20;i++)
             myCollection.add(new MyItem(i));
             return "success";
             }
            
             public void setMyCollection(Collection<MyItem> myCollection) {
             this.myCollection = myCollection;
             }
            
             public Collection<MyItem> getMyCollection() {
             return myCollection;
             }
            
             public String goToId() {
             myCollection.clear();
             return "success";
             }
            }
            
            


            I think that it's bug :(



            • 3. Re: rich:dataTable bug?
              ulrichcech

              Hi,

              ich ran exactly into the same issue.
              I insert a TabPanel, and the changing of the tab (even if switchtype is "client") is enough for the rich:dataTable to work correctly.

              Even the datascroller doesn't work (every click is "lost in space") in this situation (first, an extra request/refresh must happen to let the datascroller work).

              I changed back to h:dataTable, but I hope this is fixed in an upcoming release.

              • 4. Re: rich:dataTable bug?
                ulrichcech

                I just tested with the 3.1.0 RC2 release, and it seams to work correctly now...

                • 5. Re: rich:dataTable bug?

                   

                  "UlrichCech" wrote:
                  I just tested with the 3.1.0 RC2 release, and it seams to work correctly now...


                  Hi!
                  I'll try to check this tomorrow.
                  Thanks!

                  But I think that will be some other problems with unstable releases. e.g. I did see some problems with suggesionBox with version 3.2.0.