ICEfaces
  1. ICEfaces
  2. ICE-1545

A paginated dataTable does not properly update its content upon changes of the rows attribute

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.5.3, 1.7.2
    • Fix Version/s: 1.8RC1, 1.8
    • Component/s: ICE-Components
    • Labels:
      None
    • Environment:
      Tomcat 5.5
      Java 1.4.2
      Jboss 4.2.0

      Description

      When dynamically changing the rows attribute of the dataTable component (e.g. through a listbox to select the number of hits per page), the dataPaginator updates correctly, but the dataTable does not.
      Scenario:

      - the user paged to the end of a list of 199 items
      - the number of hits per page is changed from (say) 10 to 100
      - now, instead of displaying 99 items (the first 100 on the first page, 99 on the current page), the table only displays 9 items.

      Not a big deal, but certainly not correct, or at least counter-intuitive.
      1. SC5235.doc
        106 kB
        Tyler Johnson
      1. ICE-1545.jpg
        53 kB

        Activity

        Karl Arsch created issue -
        Hide
        User Ansel1 added a comment -

        This actually becomes very annoying when the rows attribute is changed to a high enough value to display all the rows in the table, and the paginator's renderFacetsIfSinglePage is set to false. In this case, the paginator disappears completely, while the table is still only showing a subset of the total rows.

        Even if renderFacetsIfSinglePage is set to true, the paginator buttons won't do anything once the number of pages is 1. So the user has to set the rows back down to some number that causes total pages to be > 1, flip to page one with the paginator, then set to the rows back up again.

        Show
        User Ansel1 added a comment - This actually becomes very annoying when the rows attribute is changed to a high enough value to display all the rows in the table, and the paginator's renderFacetsIfSinglePage is set to false. In this case, the paginator disappears completely, while the table is still only showing a subset of the total rows. Even if renderFacetsIfSinglePage is set to true, the paginator buttons won't do anything once the number of pages is 1. So the user has to set the rows back down to some number that causes total pages to be > 1, flip to page one with the paginator, then set to the rows back up again.
        Ken Fyten made changes -
        Field Original Value New Value
        Fix Version/s 1.7.2 [ 10130 ]
        Ken Fyten made changes -
        Assignee Ken Fyten [ ken.fyten ]
        Tyler Johnson made changes -
        Attachment icefacessampleNoLibs.zip [ 11082 ]
        Tyler Johnson made changes -
        Ken Fyten made changes -
        Assignee Priority P3
        Assignee Ken Fyten [ ken.fyten ] Adnan Durrani [ adnan.durrani ]
        Adnan Durrani made changes -
        Status Open [ 1 ] In Progress [ 3 ]
        Hide
        Adnan Durrani added a comment -

        I have build the war using the attached source code with ICEfaces 1.7.1. and I found that the pagination was not working, so after adding the following setter into the TableBean, the application is working just fine. I have also attached a war file and a snapshot.

        public void setRows(int rows)

        { this.rows = rows; }

        I have also tested the app with 1.7.0 beta and didn't find any problem either.

        The app is compiled using JAVA 5

        Show
        Adnan Durrani added a comment - I have build the war using the attached source code with ICEfaces 1.7.1. and I found that the pagination was not working, so after adding the following setter into the TableBean, the application is working just fine. I have also attached a war file and a snapshot. public void setRows(int rows) { this.rows = rows; } I have also tested the app with 1.7.0 beta and didn't find any problem either. The app is compiled using JAVA 5
        Adnan Durrani made changes -
        Status In Progress [ 3 ] Resolved [ 5 ]
        Resolution Cannot Reproduce [ 5 ]
        Adnan Durrani made changes -
        Attachment ICE-1545.jpg [ 11084 ]
        Adnan Durrani made changes -
        Attachment ICE-1545.war [ 11085 ]
        Ken Fyten made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Assignee Priority P3
        Assignee Adnan Durrani [ adnan.durrani ]
        Hide
        Tyler Johnson added a comment -

        Attached is a war file with 1.7.2 demonstrating the issue. I've also attached a word doc that describes the issue in greater detail with screenshots.

        Show
        Tyler Johnson added a comment - Attached is a war file with 1.7.2 demonstrating the issue. I've also attached a word doc that describes the issue in greater detail with screenshots.
        Tyler Johnson made changes -
        Resolution Cannot Reproduce [ 5 ]
        Status Closed [ 6 ] Reopened [ 4 ]
        Assignee Adnan Durrani [ adnan.durrani ]
        Hide
        Tyler Johnson added a comment -

        Sample application intended for deployment on Jboss 4.2.0.GA

        Show
        Tyler Johnson added a comment - Sample application intended for deployment on Jboss 4.2.0.GA
        Tyler Johnson made changes -
        Attachment ICE-1545b.war [ 11362 ]
        Attachment SC5235.doc [ 11363 ]
        Tyler Johnson made changes -
        Salesforce Case [50070000007BSFu]
        Tyler Johnson made changes -
        Environment Tomcat 5.5
        Java 1.4.2
        Tomcat 5.5
        Java 1.4.2
        Jboss 4.2.0
        Ken Fyten made changes -
        Fix Version/s 1.8DR#3 [ 10143 ]
        Fix Version/s 1.7.2 [ 10130 ]
        Affects Version/s 1.7.2 [ 10130 ]
        Hide
        Adnan Durrani added a comment -

        The dataPaginator component uses following two properties of the dataTable to calculate pages.
        -first
        -rows

        The dataPaginator component maintains the "first" property of the dataTable internally, and its value changes according to the current page. Let say:

        • There are 100 rows in the dataTable
        • 10 rows per page
        • If page 1 is selected the "first" property of the dataTable will be set to "0".
          Now if you give any value less then 100 to the the "rows" attribute, the table will show you expected result.
        • If page 10 is selected then the "first" property will be set to "90" by the dataPaginator.
          Now only 10 rows can be rendered, regardless of the value of the "row" property.

        So its mean if the application wants to change the row attribute dynamically, it should also change the "first" property.

        (e.g.)
        <ice:dataTable binding="#

        {bean.table}

        " rows="#

        {bean.rows}

        " .../>

        public void change(ValueChangeEvent event)

        { .... rows = SOMTHING table.setFirst(ZERO_OR_SOMETHING) }
        Show
        Adnan Durrani added a comment - The dataPaginator component uses following two properties of the dataTable to calculate pages. -first -rows The dataPaginator component maintains the "first" property of the dataTable internally, and its value changes according to the current page. Let say: There are 100 rows in the dataTable 10 rows per page If page 1 is selected the "first" property of the dataTable will be set to "0". Now if you give any value less then 100 to the the "rows" attribute, the table will show you expected result. If page 10 is selected then the "first" property will be set to "90" by the dataPaginator. Now only 10 rows can be rendered, regardless of the value of the "row" property. So its mean if the application wants to change the row attribute dynamically, it should also change the "first" property. (e.g.) <ice:dataTable binding="# {bean.table} " rows="# {bean.rows} " .../> public void change(ValueChangeEvent event) { .... rows = SOMTHING table.setFirst(ZERO_OR_SOMETHING) }
        Adnan Durrani made changes -
        Status Reopened [ 4 ] Resolved [ 5 ]
        Resolution Invalid [ 6 ]
        Ken Fyten made changes -
        Assignee Priority P1
        Hide
        Ken Fyten added a comment -

        I think the idea is to make it so that if the rows attribute is changed dynamically, it will automagically reset the first attribute.

        Show
        Ken Fyten added a comment - I think the idea is to make it so that if the rows attribute is changed dynamically, it will automagically reset the first attribute.
        Ken Fyten made changes -
        Resolution Invalid [ 6 ]
        Status Resolved [ 5 ] Reopened [ 4 ]
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #18123 Wed Dec 31 05:25:21 MST 2008 adnan.durrani ICE-1545 (A paginated dataTable does not properly update its content upon changes of the rows attribute )
        The change has been made so the "rows" attribute is changed dynamically, will automagically reset the first attribute to 0.
        Files Changed
        Commit graph MODIFY /icefaces/trunk/icefaces/component/src/com/icesoft/faces/component/ext/HtmlDataTable.java
        Hide
        Adnan Durrani added a comment -

        The change has been made so the "rows" attribute is changed dynamically, will automagically reset the first attribute to 0.

        trunk revision: 18123

        Show
        Adnan Durrani added a comment - The change has been made so the "rows" attribute is changed dynamically, will automagically reset the first attribute to 0. trunk revision: 18123
        Adnan Durrani made changes -
        Status Reopened [ 4 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Hide
        Mandeep Hayher added a comment -

        The fix is not working if the number of rows is changed using a commandButton:
        <ice:commandButton id="button" value="Toggle 2-5" immediate="true" actionListener="#

        {bean.btnListen}

        "/>

        The fix works fine if inputText is used to change the number f rows:
        <ice:inputText value="#

        {bean.rows}

        "/>

        Show
        Mandeep Hayher added a comment - The fix is not working if the number of rows is changed using a commandButton: <ice:commandButton id="button" value="Toggle 2-5" immediate="true" actionListener="# {bean.btnListen} "/> The fix works fine if inputText is used to change the number f rows: <ice:inputText value="# {bean.rows} "/>
        Mandeep Hayher made changes -
        Resolution Fixed [ 1 ]
        Status Resolved [ 5 ] Reopened [ 4 ]
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #18289 Wed Feb 04 12:05:24 MST 2009 adnan.durrani The first being set to 0 regard less of rows set by the UICommand or UIInput.
        related to ICE-1545 (A paginated dataTable does not properly update its content upon changes of the rows attribute)
        Files Changed
        Commit graph MODIFY /icefaces/trunk/icefaces/component/src/com/icesoft/faces/component/ext/HtmlDataTable.java
        Hide
        Adnan Durrani added a comment -

        Changes made so the first property gets set to 0, when the rows get changed dynamically either by any UIComponent.

        Modified: D:\work\development\head\svn\ossrepo\icefaces\trunk\icefaces\component\src\com\icesoft\faces\component\ext\HtmlDataTable.java
        Sending content: D:\work\development\head\svn\ossrepo\icefaces\trunk\icefaces\component\src\com\icesoft\faces\component\ext\HtmlDataTable.java
        Completed: At revision: 18289

        Show
        Adnan Durrani added a comment - Changes made so the first property gets set to 0, when the rows get changed dynamically either by any UIComponent. Modified: D:\work\development\head\svn\ossrepo\icefaces\trunk\icefaces\component\src\com\icesoft\faces\component\ext\HtmlDataTable.java Sending content: D:\work\development\head\svn\ossrepo\icefaces\trunk\icefaces\component\src\com\icesoft\faces\component\ext\HtmlDataTable.java Completed: At revision: 18289
        Adnan Durrani made changes -
        Status Reopened [ 4 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Hide
        Mandeep Hayher added a comment -

        Tested successfully with ICEFaces1.8DR1 build4 on Jboss4.2 server.
        The number of rows can now be changed dynamically and the first attribuet is reset to 0.

        Show
        Mandeep Hayher added a comment - Tested successfully with ICEFaces1.8DR1 build4 on Jboss4.2 server. The number of rows can now be changed dynamically and the first attribuet is reset to 0.
        Ken Fyten made changes -
        Fix Version/s 1.8 [ 10161 ]
        Assignee Priority P1
        Ken Fyten made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Assignee Adnan Durrani [ adnan.durrani ]
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #20927 Wed Mar 10 22:46:55 MST 2010 adnan.durrani Fix for ICE-5383 (Regression: ICE-1545 - Row number toggling does not work if at the last page of table)
        Files Changed
        Commit graph MODIFY /icefaces/trunk/icefaces/component/src/com/icesoft/faces/component/datapaginator/DataPaginator.java
        Commit graph MODIFY /icefaces/trunk/icefaces/component/src/com/icesoft/faces/component/panelseries/UISeries.java
        Commit graph MODIFY /icefaces/trunk/icefaces/component/src/com/icesoft/faces/component/datapaginator/DataPaginatorRenderer.java

          People

          • Assignee:
            Unassigned
            Reporter:
            Karl Arsch
          • Votes:
            7 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: