6 Replies Latest reply on Jan 8, 2009 5:18 AM by buttau

    ScrollableDataTable. Column widths after rerender.

    buttau

      I've found a strange behavior in an new nightly build
      RichFaces 3.3.0-20081124.104647-77.

      If I change the column width (with the mouse) and then rerender a ScrollablaDataTable, the column widths are reseted to the initial values (in my case default value 100px).

      Is this a bug ? or new Feature? Does anybody know?

        • 1. Re: ScrollableDataTable. Column widths after rerender.
          ilya_shaikovsky

          show your page code please.

          • 2. Re: ScrollableDataTable. Column widths after rerender.
            buttau

            Hi Ilya!

            Here is the page code:

            <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
            
            <html xmlns="http://www.w3.org/1999/xhtml"
             xmlns:ui="http://java.sun.com/jsf/facelets"
             xmlns:f="http://java.sun.com/jsf/core"
             xmlns:h="http://java.sun.com/jsf/html"
             xmlns:a4j="http://richfaces.org/a4j"
             xmlns:rich="http://richfaces.org/rich"
             xmlns:itc="http://www.it-choice.de/jsf/core">
            
            <head>
            <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
            <meta http-equiv="Cache-Control" content="no-cache" />
            <meta http-equiv="Pragma" content="no-cache" />
            <meta http-equiv="Expires" content="0" />
            <title>Test</title>
            </head>
            
            <body>
             <f:view contentType="text/html">
             <a4j:form id="form">
             <h:panelGrid columnClasses="panel" border="0" columns="1" width="100%">
             <rich:panel >
             <h:panelGrid columns="4">
             <a4j:commandButton value="ReRender" reRender="view" />
             </h:panelGrid>
             </rich:panel>
            
             <rich:panel id="view" >
             <f:facet name="header">
             <h:outputText value="Liste"></h:outputText>
             </f:facet>
            
             <rich:scrollableDataTable rowKeyVar="rkv" frozenColCount="1"
             height="300px" width="600px" id="viewgrid" rows="30"
             value="#{testBean.data}" var="row"
             sortMode="single">
            
             <rich:column id="c1" width="100">
             <f:facet name="header"><h:outputText value="C1" /></f:facet>
             <h:outputText value="#{row.c1}" />
             </rich:column>
             <rich:column id="c2" width="100">
             <f:facet name="header"><h:outputText value="C2" /></f:facet>
             <h:outputText value="#{row.c2}" />
             </rich:column>
             </rich:scrollableDataTable>
            
             </rich:panel>
             </h:panelGrid>
             </a4j:form>
             </f:view>
            </body>
            
            </html>
            




            And hier is the backing bean code:

            import java.util.ArrayList;
            
            public class TestBean {
             public class TestItem {
             private String c1;
             private String c2;
             public TestItem (String c1, String c2) {
             this.c1 = c1;
             this.c2 = c2;
             }
             public String getC1() {
             return c1;
             }
             public void setC1(String c1) {
             this.c1 = c1;
             }
             public String getC2() {
             return c2;
             }
             public void setC2(String c2) {
             this.c2 = c2;
             }
             }
            
             ArrayList<TestItem> data;
            
             public TestBean() {
             data = new ArrayList<TestItem>();
             for (int i=0; i<32; i++) {
             data.add(new TestItem("C1-" + i, "C2-" + i));
             }
             }
            
             public ArrayList<TestItem> getData() {
             return data;
             }
             public void setData(ArrayList<TestItem> data) {
             this.data = data;
             }
            }
            


            Tested with IE7 and FireFox 3.

            • 3. Re: ScrollableDataTable. Column widths after rerender.
              ilya_shaikovsky
              • 4. Re: ScrollableDataTable. Column widths after rerender.
                buttau

                Thank you Ilya!

                • 5. Re: ScrollableDataTable. Column widths after rerender.
                  nbelaevski

                  Hello,

                  Just tried with 3.2.0.GA, 3.2.1.GA, 3.2.2.SR1, 3.3.0.CR2. Problem reproduces in all of them, so this doesn't look like regression issue. Can you please check this for you?

                  • 6. Re: ScrollableDataTable. Column widths after rerender.
                    buttau

                    Hi Nick,
                    I checked it. You're right. I was quite sure that it worked in the version 3.2.0...