You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by "Torsten Krah (JIRA)" <de...@myfaces.apache.org> on 2006/07/12 13:34:29 UTC

[jira] Created: (TOMAHAWK-538) dataScoller displays wrong page after increasing row count on dataTable resulting in page count which is smaller than last displayed page.

dataScoller displays wrong page after increasing row count on dataTable resulting in page count which is smaller than last displayed page.
------------------------------------------------------------------------------------------------------------------------------------------

         Key: TOMAHAWK-538
         URL: http://issues.apache.org/jira/browse/TOMAHAWK-538
     Project: MyFaces Tomahawk
        Type: Bug

  Components: Data Scroller  
    Versions: 1.1.3    
 Environment: Tomcat 5.5, myfaces 1.1.3 and tomahawk 1.1.3, java 1.5
    Reporter: Torsten Krah


Using a dataScoller to navigate through the extended dataTable with dynamically changable row Count doesnt work in all combinations.

Take this example:

You got a table, initially set to 10 rows and have 20 data sets to display.
You get 2 pages in scroller with 10 rows each page.

Now change row Count to 15.
You get 2 pages, page one with 15 rows, page 2 with 5.

Now change to page 2 - important!

And now change the row Count to 20. 
You should get only one page with 20 rows now - but the scoller still shows the last 5 rows displayed and gets not updated correctly like it should be.

It also shows still this ( printed some informations for the backing bean values ):
20 Customers found, 5 Customers showing , from 16 up to 20. Page 2 / 1	

It shows Page 2 of 1 - but it should be 1 of 1, the scroller gets not updated right, if the page count gets smaller than the last displayed one.

kind regards

Torsten

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (TOMAHAWK-538) dataScoller displays wrong page after increasing row count on dataTable resulting in page count which is smaller than last displayed page.

Posted by "Torsten Krah (JIRA)" <de...@myfaces.apache.org>.
    [ https://issues.apache.org/jira/browse/TOMAHAWK-538?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12487582 ] 

Torsten Krah commented on TOMAHAWK-538:
---------------------------------------

Ok i got some workaround to solve this problem.

Analyzing the flow i would think this happens:

The state of the UIData gets restored and the old first value is used to render the table rows instead of the new correct value. (need to anlalyze a bit more to get it).
My workaround for now:

I do a binding of the dataTable, the UIData component in my bean ( theTable).
Registered a valueChangeListener and if the event happens i call:

theTable.setFirst((Integer) event.getNewValue());

The Table and the DataScroller works without any additional patches from above than.

Torsten


> dataScoller displays wrong page after increasing row count on dataTable resulting in page count which is smaller than last displayed page.
> ------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: TOMAHAWK-538
>                 URL: https://issues.apache.org/jira/browse/TOMAHAWK-538
>             Project: MyFaces Tomahawk
>          Issue Type: Bug
>          Components: Data Scroller
>    Affects Versions: 1.1.3
>         Environment: Tomcat 5.5, myfaces 1.1.3 and tomahawk 1.1.3, java 1.5
>            Reporter: Torsten Krah
>
> Using a dataScoller to navigate through the extended dataTable with dynamically changable row Count doesnt work in all combinations.
> Take this example:
> You got a table, initially set to 10 rows and have 20 data sets to display.
> You get 2 pages in scroller with 10 rows each page.
> Now change row Count to 15.
> You get 2 pages, page one with 15 rows, page 2 with 5.
> Now change to page 2 - important!
> And now change the row Count to 20. 
> You should get only one page with 20 rows now - but the scoller still shows the last 5 rows displayed and gets not updated correctly like it should be.
> It also shows still this ( printed some informations for the backing bean values ):
> 20 Customers found, 5 Customers showing , from 16 up to 20. Page 2 / 1	
> It shows Page 2 of 1 - but it should be 1 of 1, the scroller gets not updated right, if the page count gets smaller than the last displayed one.
> kind regards
> Torsten

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (TOMAHAWK-538) dataScoller displays wrong page after increasing row count on dataTable resulting in page count which is smaller than last displayed page.

Posted by "Torsten Krah (JIRA)" <de...@myfaces.apache.org>.
    [ http://issues.apache.org/jira/browse/TOMAHAWK-538?page=comments#action_12420628 ] 

Torsten Krah commented on TOMAHAWK-538:
---------------------------------------

Addition:

Made my own Renderer and changed setVariables to fix the wrong values - works fine.
The only thing i cannot get to managed how could i render the scroller with the new values correct values, it still shows the old wrong view.

Any ideas? 

kind regards

> dataScoller displays wrong page after increasing row count on dataTable resulting in page count which is smaller than last displayed page.
> ------------------------------------------------------------------------------------------------------------------------------------------
>
>          Key: TOMAHAWK-538
>          URL: http://issues.apache.org/jira/browse/TOMAHAWK-538
>      Project: MyFaces Tomahawk
>         Type: Bug

>   Components: Data Scroller
>     Versions: 1.1.3
>  Environment: Tomcat 5.5, myfaces 1.1.3 and tomahawk 1.1.3, java 1.5
>     Reporter: Torsten Krah

>
> Using a dataScoller to navigate through the extended dataTable with dynamically changable row Count doesnt work in all combinations.
> Take this example:
> You got a table, initially set to 10 rows and have 20 data sets to display.
> You get 2 pages in scroller with 10 rows each page.
> Now change row Count to 15.
> You get 2 pages, page one with 15 rows, page 2 with 5.
> Now change to page 2 - important!
> And now change the row Count to 20. 
> You should get only one page with 20 rows now - but the scoller still shows the last 5 rows displayed and gets not updated correctly like it should be.
> It also shows still this ( printed some informations for the backing bean values ):
> 20 Customers found, 5 Customers showing , from 16 up to 20. Page 2 / 1	
> It shows Page 2 of 1 - but it should be 1 of 1, the scroller gets not updated right, if the page count gets smaller than the last displayed one.
> kind regards
> Torsten

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (TOMAHAWK-538) dataScoller displays wrong page after increasing row count on dataTable resulting in page count which is smaller than last displayed page.

Posted by "Mike Kienenberger (JIRA)" <de...@myfaces.apache.org>.
    [ http://issues.apache.org/jira/browse/TOMAHAWK-538?page=comments#action_12435829 ] 
            
Mike Kienenberger commented on TOMAHAWK-538:
--------------------------------------------

I read through this issue awhile back and considered it.   But the merging of newspaperTable into t:dataTable happened after 1.1.3.

If one of those affected attaches a simplified example to the issue, I'll download it and take a look against the latest build, though.


> dataScoller displays wrong page after increasing row count on dataTable resulting in page count which is smaller than last displayed page.
> ------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: TOMAHAWK-538
>                 URL: http://issues.apache.org/jira/browse/TOMAHAWK-538
>             Project: MyFaces Tomahawk
>          Issue Type: Bug
>          Components: Data Scroller
>    Affects Versions: 1.1.3
>         Environment: Tomcat 5.5, myfaces 1.1.3 and tomahawk 1.1.3, java 1.5
>            Reporter: Torsten Krah
>         Assigned To: Mike Kienenberger
>
> Using a dataScoller to navigate through the extended dataTable with dynamically changable row Count doesnt work in all combinations.
> Take this example:
> You got a table, initially set to 10 rows and have 20 data sets to display.
> You get 2 pages in scroller with 10 rows each page.
> Now change row Count to 15.
> You get 2 pages, page one with 15 rows, page 2 with 5.
> Now change to page 2 - important!
> And now change the row Count to 20. 
> You should get only one page with 20 rows now - but the scoller still shows the last 5 rows displayed and gets not updated correctly like it should be.
> It also shows still this ( printed some informations for the backing bean values ):
> 20 Customers found, 5 Customers showing , from 16 up to 20. Page 2 / 1	
> It shows Page 2 of 1 - but it should be 1 of 1, the scroller gets not updated right, if the page count gets smaller than the last displayed one.
> kind regards
> Torsten

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (TOMAHAWK-538) dataScoller displays wrong page after increasing row count on dataTable resulting in page count which is smaller than last displayed page.

Posted by "Torsten Krah (JIRA)" <de...@myfaces.apache.org>.
    [ http://issues.apache.org/jira/browse/TOMAHAWK-538?page=comments#action_12436214 ] 
            
Torsten Krah commented on TOMAHAWK-538:
---------------------------------------

1.1.4 is affected too - dont use 1.1.5 snapshot yet. I will made a example and provide it as soon is i made it (maybe after next weekend if i got time to do it). 

thx

> dataScoller displays wrong page after increasing row count on dataTable resulting in page count which is smaller than last displayed page.
> ------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: TOMAHAWK-538
>                 URL: http://issues.apache.org/jira/browse/TOMAHAWK-538
>             Project: MyFaces Tomahawk
>          Issue Type: Bug
>          Components: Data Scroller
>    Affects Versions: 1.1.3
>         Environment: Tomcat 5.5, myfaces 1.1.3 and tomahawk 1.1.3, java 1.5
>            Reporter: Torsten Krah
>         Assigned To: Mike Kienenberger
>
> Using a dataScoller to navigate through the extended dataTable with dynamically changable row Count doesnt work in all combinations.
> Take this example:
> You got a table, initially set to 10 rows and have 20 data sets to display.
> You get 2 pages in scroller with 10 rows each page.
> Now change row Count to 15.
> You get 2 pages, page one with 15 rows, page 2 with 5.
> Now change to page 2 - important!
> And now change the row Count to 20. 
> You should get only one page with 20 rows now - but the scoller still shows the last 5 rows displayed and gets not updated correctly like it should be.
> It also shows still this ( printed some informations for the backing bean values ):
> 20 Customers found, 5 Customers showing , from 16 up to 20. Page 2 / 1	
> It shows Page 2 of 1 - but it should be 1 of 1, the scroller gets not updated right, if the page count gets smaller than the last displayed one.
> kind regards
> Torsten

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (TOMAHAWK-538) dataScoller displays wrong page after increasing row count on dataTable resulting in page count which is smaller than last displayed page.

Posted by "Torsten Krah (JIRA)" <de...@myfaces.apache.org>.
    [ http://issues.apache.org/jira/browse/TOMAHAWK-538?page=comments#action_12420635 ] 

Torsten Krah commented on TOMAHAWK-538:
---------------------------------------

Addition:

The scroller gets rendered correct - but the dataTable not. Using the scrollers last or first button, the dataTable gets updated.
How can i achive this without using the buttons, but after the scroller gets rendered after row change.

kind regards

> dataScoller displays wrong page after increasing row count on dataTable resulting in page count which is smaller than last displayed page.
> ------------------------------------------------------------------------------------------------------------------------------------------
>
>          Key: TOMAHAWK-538
>          URL: http://issues.apache.org/jira/browse/TOMAHAWK-538
>      Project: MyFaces Tomahawk
>         Type: Bug

>   Components: Data Scroller
>     Versions: 1.1.3
>  Environment: Tomcat 5.5, myfaces 1.1.3 and tomahawk 1.1.3, java 1.5
>     Reporter: Torsten Krah

>
> Using a dataScoller to navigate through the extended dataTable with dynamically changable row Count doesnt work in all combinations.
> Take this example:
> You got a table, initially set to 10 rows and have 20 data sets to display.
> You get 2 pages in scroller with 10 rows each page.
> Now change row Count to 15.
> You get 2 pages, page one with 15 rows, page 2 with 5.
> Now change to page 2 - important!
> And now change the row Count to 20. 
> You should get only one page with 20 rows now - but the scoller still shows the last 5 rows displayed and gets not updated correctly like it should be.
> It also shows still this ( printed some informations for the backing bean values ):
> 20 Customers found, 5 Customers showing , from 16 up to 20. Page 2 / 1	
> It shows Page 2 of 1 - but it should be 1 of 1, the scroller gets not updated right, if the page count gets smaller than the last displayed one.
> kind regards
> Torsten

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (TOMAHAWK-538) dataScoller displays wrong page after increasing row count on dataTable resulting in page count which is smaller than last displayed page.

Posted by "Torsten Krah (JIRA)" <de...@myfaces.apache.org>.
    [ http://issues.apache.org/jira/browse/TOMAHAWK-538?page=comments#action_12423384 ] 
            
Torsten Krah commented on TOMAHAWK-538:
---------------------------------------

Maybe some fixes - comments appreciated. 
The Renderer needs this:

String pageIndexVar = scroller.getPageIndexVar();
        if (pageIndexVar != null)
        {
            int pageIndex = (scroller.getRowCount() > 0)? scroller.getPageIndex() : 0;
+            if(scroller.getPageCount() < pageIndex)
+                pageIndex = scroller.getPageCount();
            requestMap.put(pageIndexVar, new Integer(pageIndex));
        }

The DataScroller this instead of the original one - look at the broadcast method, there i think this case is handled too, the firstRow can everytime be calculated with the index and the rows ( its done so in the broadcast method too)- using only getFirst() won't work in certain cases, like described.

public int getFirstRow() {
        int firstRowIndex = getUIData().getFirst();
        int pageIndex = getPageIndex();
        int pageCount = getPageCount();

        if (pageIndex > pageCount) {
            pageIndex = pageCount;
        }
        
        firstRowIndex = (pageIndex - 1) * getRows();
        getUIData().setFirst(firstRowIndex); 
        return firstRowIndex;
    }

Now the scroller works nearly - but i don't get the table updated in it - all variables seems to have the right value.

If i call getUIData().setFirst(0) it redisplays the table and it works, but is broken for other things - but if i calculate the variable and it is 0 - it won't. Checked that it is 0 in all calls of getFirstRow with debug output - won't work ... still needs to be fixed.
Is there any other variable responsible for that what i want to do maybe?

kind regards

> dataScoller displays wrong page after increasing row count on dataTable resulting in page count which is smaller than last displayed page.
> ------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: TOMAHAWK-538
>                 URL: http://issues.apache.org/jira/browse/TOMAHAWK-538
>             Project: MyFaces Tomahawk
>          Issue Type: Bug
>          Components: Data Scroller
>    Affects Versions: 1.1.3
>         Environment: Tomcat 5.5, myfaces 1.1.3 and tomahawk 1.1.3, java 1.5
>            Reporter: Torsten Krah
>
> Using a dataScoller to navigate through the extended dataTable with dynamically changable row Count doesnt work in all combinations.
> Take this example:
> You got a table, initially set to 10 rows and have 20 data sets to display.
> You get 2 pages in scroller with 10 rows each page.
> Now change row Count to 15.
> You get 2 pages, page one with 15 rows, page 2 with 5.
> Now change to page 2 - important!
> And now change the row Count to 20. 
> You should get only one page with 20 rows now - but the scoller still shows the last 5 rows displayed and gets not updated correctly like it should be.
> It also shows still this ( printed some informations for the backing bean values ):
> 20 Customers found, 5 Customers showing , from 16 up to 20. Page 2 / 1	
> It shows Page 2 of 1 - but it should be 1 of 1, the scroller gets not updated right, if the page count gets smaller than the last displayed one.
> kind regards
> Torsten

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (TOMAHAWK-538) dataScoller displays wrong page after increasing row count on dataTable resulting in page count which is smaller than last displayed page.

Posted by "Torsten Krah (JIRA)" <de...@myfaces.apache.org>.
    [ https://issues.apache.org/jira/browse/TOMAHAWK-538?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12487585 ] 

Torsten Krah commented on TOMAHAWK-538:
---------------------------------------

Forget the last workaroud, only works if the rows gets not greater or equal than the actual data rows available.

if(theTable.getRowCount() <= first)
        first = 0;

is needed too to make the table render correct.
But the scroller is broken after that and does not render its pages correct anymore, i'll report again if i think i got it - maybe :-).

> dataScoller displays wrong page after increasing row count on dataTable resulting in page count which is smaller than last displayed page.
> ------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: TOMAHAWK-538
>                 URL: https://issues.apache.org/jira/browse/TOMAHAWK-538
>             Project: MyFaces Tomahawk
>          Issue Type: Bug
>          Components: Data Scroller
>    Affects Versions: 1.1.3
>         Environment: Tomcat 5.5, myfaces 1.1.3 and tomahawk 1.1.3, java 1.5
>            Reporter: Torsten Krah
>
> Using a dataScoller to navigate through the extended dataTable with dynamically changable row Count doesnt work in all combinations.
> Take this example:
> You got a table, initially set to 10 rows and have 20 data sets to display.
> You get 2 pages in scroller with 10 rows each page.
> Now change row Count to 15.
> You get 2 pages, page one with 15 rows, page 2 with 5.
> Now change to page 2 - important!
> And now change the row Count to 20. 
> You should get only one page with 20 rows now - but the scoller still shows the last 5 rows displayed and gets not updated correctly like it should be.
> It also shows still this ( printed some informations for the backing bean values ):
> 20 Customers found, 5 Customers showing , from 16 up to 20. Page 2 / 1	
> It shows Page 2 of 1 - but it should be 1 of 1, the scroller gets not updated right, if the page count gets smaller than the last displayed one.
> kind regards
> Torsten

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (TOMAHAWK-538) dataScoller displays wrong page after increasing row count on dataTable resulting in page count which is smaller than last displayed page.

Posted by "Mike Kienenberger (JIRA)" <de...@myfaces.apache.org>.
    [ https://issues.apache.org/jira/browse/TOMAHAWK-538?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12485266 ] 

Mike Kienenberger commented on TOMAHAWK-538:
--------------------------------------------

I went ahead and enhanced the datascroller.jsf example so this is easier to test.

> dataScoller displays wrong page after increasing row count on dataTable resulting in page count which is smaller than last displayed page.
> ------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: TOMAHAWK-538
>                 URL: https://issues.apache.org/jira/browse/TOMAHAWK-538
>             Project: MyFaces Tomahawk
>          Issue Type: Bug
>          Components: Data Scroller
>    Affects Versions: 1.1.3
>         Environment: Tomcat 5.5, myfaces 1.1.3 and tomahawk 1.1.3, java 1.5
>            Reporter: Torsten Krah
>
> Using a dataScoller to navigate through the extended dataTable with dynamically changable row Count doesnt work in all combinations.
> Take this example:
> You got a table, initially set to 10 rows and have 20 data sets to display.
> You get 2 pages in scroller with 10 rows each page.
> Now change row Count to 15.
> You get 2 pages, page one with 15 rows, page 2 with 5.
> Now change to page 2 - important!
> And now change the row Count to 20. 
> You should get only one page with 20 rows now - but the scoller still shows the last 5 rows displayed and gets not updated correctly like it should be.
> It also shows still this ( printed some informations for the backing bean values ):
> 20 Customers found, 5 Customers showing , from 16 up to 20. Page 2 / 1	
> It shows Page 2 of 1 - but it should be 1 of 1, the scroller gets not updated right, if the page count gets smaller than the last displayed one.
> kind regards
> Torsten

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.