1 2 3 Previous Next 32 Replies Latest reply on Oct 15, 2008 6:07 AM by andreas_back

    rich:scrollableDataTable columnheader disappears

    Rolf Lehnert Newbie

      Hi,
      I use RichFaces 3.2.1 and have problems with the rich:scrollableDataTable, rich:columns and the a4j:commandLink.
      When I start my application in IE, all column headers are displayed correctly.
      When I start my application in Firefox, no column header is displayed.
      If I invoke the rerender method in IE, the column headers disappear in IE also.
      This problem is only by use the rich:scrollableDataTable and not by use rich:datatable.

      Simple Eclipse demo project (475 KB): http://www.lehnert-online.de/richfaces/tableTest.zip

      My xHtml code:

      <?xml version="1.0" encoding="iso-8859-1"?>
      <!DOCTYPE ui:component PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
      
      <ui:component xmlns="http://www.w3.org/1999/xhtml"
       xmlns:f="http://java.sun.com/jsf/core"
       xmlns:c="http://java.sun.com/jstl/core"
       xmlns:h="http://java.sun.com/jsf/html"
       xmlns:ui="http://java.sun.com/jsf/facelets"
       xmlns:a4j="http://richfaces.org/a4j"
       xmlns:rich="http://richfaces.org/rich">
      
       <f:view contentType="text/html">
       <h:form>
       <rich:scrollableDataTable id="dataList" width="300" height="300" border="0" var="data" value="#{tableBean.data}">
       <rich:columns value="#{tableBean.columnModel}" var="col" index="index" sortable="no">
       <f:facet name="header">
       <a4j:commandLink value="#{col.title}" action="#{col.sort}" reRender="dataList" />
       </f:facet>
       <h:outputText value="#{data.columns[index]}" />
       </rich:columns>
       </rich:scrollableDataTable>
       <br />
       </h:form>
       </f:view>
      </ui:component>
      


      My java code:
      package de.intermoves.listenvalidierung.datatable.beans;
      
      import java.util.ArrayList;
      import java.util.Date;
      
      import de.intermoves.listenvalidierung.datatable.data.ColumnModel;
      import de.intermoves.listenvalidierung.datatable.data.Data;
      
      public class TableBean {
       private ArrayList<Data> data= null;
       private ArrayList<ColumnModel> columnModel= null;
      
      public ArrayList<Data> getData() {
       if(data==null) {
       data= new ArrayList<Data>();
       Date date= new Date();
       data.add(Data.newInstance("1","red house", "100 - "+date.getTime()));
       data.add(Data.newInstance("2","grey house", "101 - "+date.getTime()));
       data.add(Data.newInstance("3","white house", "102 - "+date.getTime()));
       data.add(Data.newInstance("4","black house", "103 - "+date.getTime()));
       }
       return data;
      }
      
      public void setData(ArrayList<Data> data) {
       this.data = data;
      }
      
      public ArrayList<ColumnModel> getColumnModel() {
       if(columnModel==null) {
       columnModel= new ArrayList<ColumnModel>();
       columnModel.add(ColumnModel.newInstance("Identifier"));
       columnModel.add(ColumnModel.newInstance("Name"));
       columnModel.add(ColumnModel.newInstance("Value"));
       }
       return columnModel;
      }
      
      public void setColumnModel(ArrayList<ColumnModel> columnModel) {
       this.columnModel = columnModel;
      }
      }
      


      package de.intermoves.listenvalidierung.datatable.data;
      
      import java.io.Serializable;
      
      public class Data implements Serializable {
       private String[] columns= null;
      
       public String[] getColumns() {
       return columns;
       }
      
       public void setColumns(String[] columns) {
       this.columns = columns;
       }
      
       public static Data newInstance(String identifier, String name, String value) {
       Data data= new Data();
       String[] columns= new String[3];
       columns[0]= identifier;
       columns[1]= name;
       columns[2]= value;
       data.setColumns(columns);
       return data;
       }
      
      
      
       @Override
       public String toString() {
       return columns[0]+columns[1]+columns[2];
      
       }
      
       @Override
       public int hashCode() {
       return toString().hashCode();
       }
      
       @Override
       public boolean equals(Object other) {
       if (this == other) {
       return true;
       }
       if (!(other instanceof Data)) {
       return false;
       } else {
       Data myother = (Data) other;
       if (this.toString().length() == 0) {
       if (myother.toString().length() == 0) {
       return true;
       } else {
       return false;
       }
       } else {
       if (myother.toString().length() == 0) {
       return false;
       } else {
       return (this.toString()).equals(myother.toString());
       }
       }
       }
       }
      }
      


      package de.intermoves.listenvalidierung.datatable.data;
      
      import java.io.Serializable;
      
      public class ColumnModel implements Serializable {
       private String title;
      
       public String getTitle() {
       return title;
       }
      
       public void setTitle(String title) {
       this.title = title;
       }
      
       public static ColumnModel newInstance(String title) {
       ColumnModel columnModel= new ColumnModel();
       columnModel.setTitle(title);
       return columnModel;
       }
      
       public void sort() {
      
       }
      
       @Override
       public String toString() {
       return title;
      
       }
      
       @Override
       public int hashCode() {
       return toString().hashCode();
       }
      
       @Override
       public boolean equals(Object other) {
       if (this == other) {
       return true;
       }
       if (!(other instanceof Data)) {
       return false;
       } else {
       Data myother = (Data) other;
       if (this.toString().length() == 0) {
       if (myother.toString().length() == 0) {
       return true;
       } else {
       return false;
       }
       } else {
       if (myother.toString().length() == 0) {
       return false;
       } else {
       return (this.toString()).equals(myother.toString());
       }
       }
       }
       }
      }
      


      Does anyone knows a solution on this?

      Thanks
      Rolf

        • 1. Re: rich:scrollableDataTable columnheader disappears
          jobinesh Newbie

          Hello
          I'm also facing the same issue. Any solution/work around?

          Thanks
          Jobinesh

          • 2. Re: rich:scrollableDataTable columnheader disappears
            andreas_back Novice

            Hello!

            With the example project of Rolf his observations are reproducible
            under Tomcat 6.0.16 and Windows XP on my computer.

            If someone clicks on the links in the column headers then a refresh is
            of the table data is issued, but the column headers disappear.

            This can also be archieved by using an a4j:commondButton outside
            of the table:

            <a4j:commandButton value="refresh" reRender="dataList"/>


            As it is mentiioned in

            http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4094629#4094629


            a h:commandButton or a h:commandLink is used
            the table columns do not disappear after a refresh of the page,
            but of course this causes a full page refresh.

            It also can be reproduced that within the Firefox browser no
            column headers are visible at all for this example.

            It may be noted that the rich:columns tag is used in the sample code.

            It would be great if someone of the QA team could have a look on this
            so that a fix could make it into the 3.2.2 GA release.

            Shall we issue a bug report?

            Greetings

            Andreas

            • 3. Re: rich:scrollableDataTable columnheader disappears
              Daniel Young Novice

              Hi all,

              I'm having the same problem here with rich:scrollableDataTable in 3.2.1.GA. The column header disappears while doing a reRender in IE7, and totally disappears and the table columns lose all styling in Firefox 3.

              It would be really great to see a fix for 3.2.2?

              • 4. Re: rich:scrollableDataTable columnheader disappears
                andreas_back Novice

                Hello!

                There is now a bug report for this issue:

                http://jira.jboss.com/jira/browse/RF-3796

                It is open source, you can vote for a bug fix!

                Greetings

                Andreas

                • 5. Re: rich:scrollableDataTable columnheader disappears
                  Daniel Young Novice

                  I've added my vote -- thanks for creating the JIRA, Andreas!

                  • 6. Re: rich:scrollableDataTable columnheader disappears
                    Daniel Young Novice

                    The JIRA has been closed as "Cannot Reproduce". Does that mean couldn't reproduce in 3.2.1 or in current development code??

                    This is a high priority issue for us which can't wait until 3.2.2 comes out.

                    • 7. Re: rich:scrollableDataTable columnheader disappears
                      Denis Marzadro Novice

                      The bug has closed as "Cannot Reproduce" but we have the same problem on richfaces 3.2.1GA (RI 1.2, jsp, tomcat 6).
                      Could help (to reproduce the problem) know we have TWO scrollable data table in the same panel.

                      For who have the problem: now we solved using a scrollable data table and a simple datatable.

                      Just lo let developer people know the bug still exist.

                      greetings

                      • 8. Re: rich:scrollableDataTable columnheader disappears
                        Sergio Del Valle Newbie

                        Same problem here with RichFaces 3.2.1, Facelets 1.1.13, Mojarra 1.2_07-b03-FCS.

                        Regards

                        • 9. Re: rich:scrollableDataTable columnheader disappears
                          Konstantin Mishin Novice

                          I cannot reproduce this bag on richfaces 3.2.2-SNAPSHOT.

                          • 10. Re: rich:scrollableDataTable columnheader disappears
                            Daniel Young Novice

                            Yes I've just tested the latest 3.2.2-SNAPSHOT and can confirm that this problem is no longer there. However, the snapshot brings me other problems (division by zero stack traces in ScrollableDataTableBaseRenderer).

                            When will 3.2.2 proper be released?

                            • 11. Re: rich:scrollableDataTable columnheader disappears
                              andreas_back Novice

                              Hello!

                              Yes, we have done some tests with the 3.2.2-SNAPSHOT 20080702.044834-26 and the problem is not present anymore with the IE 7 and Firefox 3.0. That's great!

                              But there remains an open point for Firefox 2.0.X and Safari 3.1.X.

                              If we do not set the content type within the page by using the following tag

                              <f:view contentType="text/html">
                              

                              and there are no special characters in the data that is displayed on the page
                              and especially within the datatable, then the header of the table appears
                              under Firefox 2.0.X and Safari 3.1.X as well. That is okay as well.


                              Buf if there are special characters on the page and the contentType is not set
                              to text/html then the whole page is not rendered due to a parsing error in FF2 and Safari 3.1.X.

                              As Sergey Smirnov stated in

                              http://jboss.com/index.html?module=bb&op=viewtopic&t=113525
                              and also see http://jira.jboss.com/jira/browse/RF-457

                              In general, facelets starts to set the content type to "xhtml" by default when recognizes the jsf 1.2.


                              We confirmed this by analysing the http - header via wireshark.
                              The point is that the HTML contains HTML-codes for the special characters
                              and not the XML codes. But the server sends these pages with the content type
                              Content-Type: application/xhtml+xml;charset=UTF-8
                              to the browser.

                              For example expat in FF 2.0 detects these HTML-Codes as errors, see
                              http://www.mozilla.org/docs/web-developer/faq.html#xhtmldiff

                              If the content type of the page is set to text/html then the content type text/hmtl
                              Content-Type: text/html;charset=utf-8

                              is used in the http header and the table header is missing in FF2.0 and Safari 3.1.X.


                              In summary at the moment we see no possibility to use special characters with rich:columns in FF 2.0 and Safari 3.1.X. But we have many Mac- users as customers.

                              Any hint is appreciated.

                              Greeings

                              Andreas



                              • 12. Re: rich:scrollableDataTable columnheader disappears
                                Denis Marzadro Novice

                                We tried with richfaces 3.2.2 BETA1 and tomcat 6.0 and the problem, using two scrollabledatatable, still there. Attacched a zip with a little test webapp (url = http://localhost:8080/TestRichScrollableDataTable/display.jsf).

                                http://www.marcoangheben.com/tmp/TestRichScrollableDataTable.zip

                                greetings

                                • 13. Re: rich:scrollableDataTable columnheader disappears
                                  andreas_back Novice

                                  Hello,

                                  this postings informs you about two oberservations while devoloping with
                                  the rich:scrollableDataTable and rich:columns with Snapshot 3.2.2-20080702
                                  and Snapshot 3.2.2-20080722.043531-41.

                                  A) We found a StringIndexOutOfBoundsExecption when the content of the
                                  table is refreshed. The exeption occurs if a treshold for a number
                                  of cells is reached, for example if there are more then 7 columns
                                  and 10 rows.

                                  Here is the exception:

                                  18.07.2008 15:08:48 com.sun.facelets.FaceletViewHandler handleRenderException
                                  SCHWERWIEGEND: Error Rendering View[/dataTable/dataTable.xhtml]
                                  java.lang.StringIndexOutOfBoundsException: srcBegin > srcEnd
                                   at java.lang.AbstractStringBuilder.getChars(Unknown Source)
                                   at java.lang.StringBuilder.getChars(Unknown Source)
                                   at com.sun.faces.renderkit.html_basic.HtmlResponseWriter.flushAttributes(HtmlResponseWriter.java:981)
                                   at com.sun.faces.renderkit.html_basic.HtmlResponseWriter.endElement(HtmlResponseWriter.java:489)
                                   at org.ajax4jsf.renderkit.AjaxRendererUtils.encodeAreas(AjaxRendererUtils.java:716)
                                   at org.ajax4jsf.renderkit.AjaxContainerRenderer.encodeAjax(AjaxContainerRenderer.java:125)
                                   at org.ajax4jsf.component.AjaxViewRoot.encodeAjax(AjaxViewRoot.java:673)
                                   at org.ajax4jsf.component.AjaxViewRoot.encodeChildren(AjaxViewRoot.java:544)
                                   at javax.faces.component.UIComponent.encodeAll(UIComponent.java:936)
                                   at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:578)
                                   at org.ajax4jsf.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:108)
                                   at org.ajax4jsf.application.AjaxViewHandler.renderView(AjaxViewHandler.java:191)
                                   at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:109)
                                   at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100)
                                   at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
                                   at javax.faces.webapp.FacesServlet.service(FacesServlet.java:266)
                                   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
                                   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                                   at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:154)
                                   at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:265)
                                   at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:376)
                                   at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:503)
                                   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
                                   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                                   at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
                                   at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
                                   at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
                                   at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
                                   at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
                                   at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
                                   at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
                                   at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
                                   at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
                                   at java.lang.Thread.run(Unknown Source)


                                  You can find a war-Archive with an example application under the following url:

                                  http://www.intermoves.de/fileadmin/richfaces/ListenValidator.war

                                  The war-Archive was build with JDK 1.6.0_02 and has been tested with apache-tomcat-6.0.16.

                                  A zip-Archive with an eclipse 3.2.2 project (for Windows XP) can be found under this url:

                                  http://www.intermoves.de/fileadmin/richfaces/ListenValidator.zip

                                  For a local deployment the URL of the application in the war archive is

                                  http://localhost:8080/ListenValidator

                                  The exception can be produced if one of the links in the header of the table is clicked.

                                  This exception could be produced with several browsers, for example the IE 7
                                  or the Firefox 3.0.1

                                  B) For this example table under A) we have seen two issues when the table is scrolled.

                                  B.1 If the Firefox 3.0.1 browser is used to scroll within the example table that
                                  is mentioned under A) then the table shows some oszillating behavior before
                                  it scrolls the to destination position. For Firefox 2.0.X of IE 7 we do not
                                  see this behavior. This oszillation behavior was already present in the
                                  3.2.2-20080702 snapshot

                                  B.2 Under Safari 3.1.2 (525.21) it is not possible to move the
                                  scrollbar to the bottom of the table in one scrolling, the scrolling bar
                                  pauses several times. But if you try serveral times the bottom lines
                                  of the table can be reached.

                                  It would be great if these points could be fixed for the 3.2.2 GA.

                                  • 14. Re: rich:scrollableDataTable columnheader disappears
                                    Mark Rich Newbie

                                    keep tracking this problem. it's the component I really need in my application. Hope it can be solved asap.

                                    1 2 3 Previous Next