5 Replies Latest reply on Sep 12, 2013 12:48 PM by bleathem

    Error on resizing column in rich:extendedDataTable

    ibenjes

      Hi,

       

      RichFaces 4.3.3 with Seam 2.3 on JBoss EAP 6.1:

       

      I've got one rich:extendedDataTable where when I try to resize a column I get the following javascript error:

       

      Uncaught Error: Cannot find the stylesheet for column 'evType' packed.js:11526

      richfaces.ui.ExtendedDataTable.richfaces.BaseComponent.extendClass.getColumnStyle packed.js:11526

      richfaces.ui.ExtendedDataTable.richfaces.BaseComponent.extendClass.setColumnWidth packed.js:11507

      richfaces.ui.ExtendedDataTable.richfaces.BaseComponent.extendClass.endResize packed.js:11808

      proxy jquery-1.8.3.js:775

      fn jquery-1.8.3.js:3529

      jQuery.event.dispatch jquery-1.8.3.js:3058

      elemData.handle.eventHandle

       

      'evType' is the ID of the column I am trying to resize (if you resize a different column you get a different id there).

       

      The javascript code where it fails is:

       

      getColumnStyle: function(columnId) {
                      var tableId = this.element.id;
                      var columnClass = WIDTH_CLASS_NAME_BASE + columnId;
                      var stylesheet = richfaces.utils.findCSSRule(function(selector) {
                          return selector.indexOf(columnClass) !== -1 && selector.indexOf(tableId) !== -1;
                      });
                      if (!stylesheet) {
                          throw new Error("Cannot find the stylesheet for column '" + columnId + "'");
                      }
                      return stylesheet.style;
                  },
      
      
      

       

       

      The odd thing is I don't get that error on other tables I have and I can't see anything wrong with the table:

       

      <rich:extendedDataTable
            id="TBtrackViewE"
                value="#{backingBean.results}"
                tableState="#{userProfile.tableState}"
                headerClass="dobr"
                onRowMouseOver="tableRowColor=this.style.backgroundColor;this.style.backgroundColor=tableRowHighlight"
                onRowMouseOut="this.style.backgroundColor=tableRowColor"
                rowClasses="tableRowOdd, tableRowEven"
                height="100%"
                width="100%"
                render="DVtrackview"
                var="c"
                styleClass="listTable dataTable">
                <rich:column id="contNum" width="150" label="#{messages['number']}" sortable="true" sortBy="#{c.number}">
                    <f:facet name="header">#{messages['number']}</f:facet>
                    <h:outputText value="#{c.number}"/>
                </rich:column>
                <rich:column id="evDate" width="85" label="#{messages['date']}" sortable="true" sortBy="#{c.eventDatetime}">
                    <f:facet name="header">#{messages['date']}</f:facet>
                    <h:outputText value="#{c.eventDatetime}">
                        <s:convertDateTime type="date" pattern="#{userProfile.dateFormat}"/>
                    </h:outputText>
                </rich:column>
                 ....
      </rich:extendedDataTable>
      
      
      

       

      Has anyone else had a similar problem?

        • 1. Re: Error on resizing column in rich:extendedDataTable
          bleathem

          Do you still get this error is you disable resource optimisation?

          • 2. Re: Error on resizing column in rich:extendedDataTable
            ibenjes

            Brian Leathem wrote:

             

            Do you still get this error is you disable resource optimisation?

            Yes,

            1. Uncaught Error: Cannot find the stylesheet for column 'evTime' extendedDataTable.js.seam?ln=org.richfaces:254
              1. richfaces.ui.ExtendedDataTable.richfaces.BaseComponent.extendClass.getColumnStyleextendedDataTable.js.seam?ln=org.richfaces:254
              2. richfaces.ui.ExtendedDataTable.richfaces.BaseComponent.extendClass.setColumnWidthextendedDataTable.js.seam?ln=org.richfaces:235
              3. richfaces.ui.ExtendedDataTable.richfaces.BaseComponent.extendClass.endResizeextendedDataTable.js.seam?ln=org.richfaces:536
              4. proxyjquery-1.8.3.js:775
              5. fnjquery-1.8.3.js:3529
              6. jQuery.event.dispatchjquery-1.8.3.js:3058
              7. elemData.handle.eventHandle


            • 3. Re: Error on resizing column in rich:extendedDataTable
              bleathem

              Do you by chance set prependId='false' in your form?  Can you post your complete facelet code?

               

              Column resizing works in the showcase:

              http://showcase.richfaces.org/richfaces/component-sample.jsf?demo=extendedDataTable&skin=blueSky

               

              You can try comparing your impl to the one in the showcase and see where it differs that might lead to this failure.

              • 4. Re: Error on resizing column in rich:extendedDataTable
                ibenjes

                No I am not using prependId="false".

                 

                On one table the problem went away when I removed ajaxRendered="true" from a surrounding a:outputPanel.

                 

                On another table the problem still exists. That particular table is in a ui:repeat, so there can be multiple tables on the same page. I guess the ui:repeat will prepend another ID so instead of formId:columnId you get formId:repeatIDxxx:columnId. Could that be the problem?

                 

                Another problem I've noticed is that when you change the column size the vertical dotted line and arrow is only shown for a brief moment, when you move the  column boarder a bit more the arrow and vertical line disappears. It still change the column width though.

                I have this behaviour across the board. Could this be due to some CSS changes I had to make (the extendedDataTable styling doesn't work with table which contain multiple lines).

                 

                One thing I am missing from RF3 is the 'spinning logo' when you change the column order. Now it just sits there and the user things nothing is happening. On a complex table this can take a while!

                 

                If I find some time I will try to 'extract' an example which highlights the problems we are having.

                • 5. Re: Error on resizing column in rich:extendedDataTable
                  bleathem

                  Immo Benjes wrote:

                   

                  No I am not using prependId="false".

                   

                  On one table the problem went away when I removed ajaxRendered="true" from a surrounding a:outputPanel.

                   

                  On another table the problem still exists. That particular table is in a ui:repeat, so there can be multiple tables on the same page. I guess the ui:repeat will prepend another ID so instead of formId:columnId you get formId:repeatIDxxx:columnId. Could that be the problem?

                   

                  Try using a4j:repeat instead, it's a bit "smarter" than ui:repeat.

                   

                  Immo Benjes wrote:

                   

                  Another problem I've noticed is that when you change the column size the vertical dotted line and arrow is only shown for a brief moment, when you move the  column boarder a bit more the arrow and vertical line disappears. It still change the column width though.

                  I have this behaviour across the board. Could this be due to some CSS changes I had to make (the extendedDataTable styling doesn't work with table which contain multiple lines).

                   

                  It works as expected in the showcase example?  If so it could be your CSS changes.  Check the browser console for errors.  Hard to say anymore without seeing the relevant facelet and CSS.

                   

                  Immo Benjes wrote:

                   

                  One thing I am missing from RF3 is the 'spinning logo' when you change the column order. Now it just sits there and the user things nothing is happening. On a complex table this can take a while!

                   

                  Are you able to achieve this using the a4j:status component?

                   

                  Immo Benjes wrote:

                   

                  If I find some time I will try to 'extract' an example which highlights the problems we are having.

                   

                  Great, that will help.