You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by "Stephan (JIRA)" <my...@incubator.apache.org> on 2005/05/27 15:39:54 UTC

[jira] Created: (MYFACES-259) datatable, datascroller problem with mbean in session scope

datatable, datascroller problem with mbean in session scope
-----------------------------------------------------------

         Key: MYFACES-259
         URL: http://issues.apache.org/jira/browse/MYFACES-259
     Project: MyFaces
        Type: Bug
    Versions: 1.0.9 beta    
    Reporter: Stephan
 Attachments: HitBean_snippet.java, hitlist_snippet.jsf

I have a MBean in session scope, which holds the data for the datatable. 

The scroller for the table works fine, when I use it once or the rowCount of data never changes. But I get in trouble when I change the page of the scroller and change the rowCount.

Example:

1. datatable has 100 rows, scroller shows 10 rows
2. I jump to page 5
... everything is fine

After this the data changes ... the datatable has now 5 rows

And now the problem comes out: The pageIndex of the scrollerComponent is still on page 5 ... and ... there is no data. When I jump to page 1 manually (by rewind-button) the data shows up on the first page.

I tried all the examples with this combination and got allways the same situation. So, I think it could be a bug ...

-- 
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] Updated: (MYFACES-259) datatable, datascroller problem with mbean in session scope

Posted by "Stephan (JIRA)" <my...@incubator.apache.org>.
     [ http://issues.apache.org/jira/browse/MYFACES-259?page=all ]

Stephan updated MYFACES-259:
----------------------------

    Attachment: DatatableTestBean.java

> datatable, datascroller problem with mbean in session scope
> -----------------------------------------------------------
>
>          Key: MYFACES-259
>          URL: http://issues.apache.org/jira/browse/MYFACES-259
>      Project: MyFaces
>         Type: Bug
>     Versions: 1.0.9 beta
>     Reporter: Stephan
>  Attachments: DatatableTestBean.java, HitBean_snippet.java, dataScroller.jsp, hitlist_snippet.jsf, output.txt
>
> I have a MBean in session scope, which holds the data for the datatable. 
> The scroller for the table works fine, when I use it once or the rowCount of data never changes. But I get in trouble when I change the page of the scroller and change the rowCount.
> Example:
> 1. datatable has 100 rows, scroller shows 10 rows
> 2. I jump to page 5
> ... everything is fine
> After this the data changes ... the datatable has now 5 rows
> And now the problem comes out: The pageIndex of the scrollerComponent is still on page 5 ... and ... there is no data. When I jump to page 1 manually (by rewind-button) the data shows up on the first page.
> I tried all the examples with this combination and got allways the same situation. So, I think it could be a bug ...

-- 
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] Closed: (MYFACES-259) datatable, datascroller problem with mbean in session scope

Posted by "Mathias Broekelmann (JIRA)" <my...@incubator.apache.org>.
     [ http://issues.apache.org/jira/browse/MYFACES-259?page=all ]
     
Mathias Broekelmann closed MYFACES-259:
---------------------------------------

    Resolution: Won't Fix

I see the problem but I don´t see a way to solve it.

Try to set the first attribute of the datatable to a meaningfull value after you have changed the rowcount of your datamodel. Neither datatable nor datascroller are able to define what a meaningfull value is as it depends IMO on your business case.

> datatable, datascroller problem with mbean in session scope
> -----------------------------------------------------------
>
>          Key: MYFACES-259
>          URL: http://issues.apache.org/jira/browse/MYFACES-259
>      Project: MyFaces
>         Type: Bug
>     Versions: 1.0.9 beta
>     Reporter: Stephan
>     Assignee: Mathias Broekelmann
>  Attachments: DatatableTestBean.java, HitBean_snippet.java, dataScroller.jsp, hitlist_snippet.jsf, output.txt
>
> I have a MBean in session scope, which holds the data for the datatable. 
> The scroller for the table works fine, when I use it once or the rowCount of data never changes. But I get in trouble when I change the page of the scroller and change the rowCount.
> Example:
> 1. datatable has 100 rows, scroller shows 10 rows
> 2. I jump to page 5
> ... everything is fine
> After this the data changes ... the datatable has now 5 rows
> And now the problem comes out: The pageIndex of the scrollerComponent is still on page 5 ... and ... there is no data. When I jump to page 1 manually (by rewind-button) the data shows up on the first page.
> I tried all the examples with this combination and got allways the same situation. So, I think it could be a bug ...

-- 
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] Updated: (MYFACES-259) datatable, datascroller problem with mbean in session scope

Posted by "Stephan (JIRA)" <my...@incubator.apache.org>.
     [ http://issues.apache.org/jira/browse/MYFACES-259?page=all ]

Stephan updated MYFACES-259:
----------------------------

    Attachment: dataScroller.jsp

> datatable, datascroller problem with mbean in session scope
> -----------------------------------------------------------
>
>          Key: MYFACES-259
>          URL: http://issues.apache.org/jira/browse/MYFACES-259
>      Project: MyFaces
>         Type: Bug
>     Versions: 1.0.9 beta
>     Reporter: Stephan
>  Attachments: DatatableTestBean.java, HitBean_snippet.java, dataScroller.jsp, hitlist_snippet.jsf, output.txt
>
> I have a MBean in session scope, which holds the data for the datatable. 
> The scroller for the table works fine, when I use it once or the rowCount of data never changes. But I get in trouble when I change the page of the scroller and change the rowCount.
> Example:
> 1. datatable has 100 rows, scroller shows 10 rows
> 2. I jump to page 5
> ... everything is fine
> After this the data changes ... the datatable has now 5 rows
> And now the problem comes out: The pageIndex of the scrollerComponent is still on page 5 ... and ... there is no data. When I jump to page 1 manually (by rewind-button) the data shows up on the first page.
> I tried all the examples with this combination and got allways the same situation. So, I think it could be a bug ...

-- 
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] Updated: (MYFACES-259) datatable, datascroller problem with mbean in session scope

Posted by "Stephan (JIRA)" <my...@incubator.apache.org>.
     [ http://issues.apache.org/jira/browse/MYFACES-259?page=all ]

Stephan updated MYFACES-259:
----------------------------

    Attachment: hitlist_snippet.jsf

code snippet of the jsf with the datatable and the scroller

> datatable, datascroller problem with mbean in session scope
> -----------------------------------------------------------
>
>          Key: MYFACES-259
>          URL: http://issues.apache.org/jira/browse/MYFACES-259
>      Project: MyFaces
>         Type: Bug
>     Versions: 1.0.9 beta
>     Reporter: Stephan
>  Attachments: HitBean_snippet.java, hitlist_snippet.jsf
>
> I have a MBean in session scope, which holds the data for the datatable. 
> The scroller for the table works fine, when I use it once or the rowCount of data never changes. But I get in trouble when I change the page of the scroller and change the rowCount.
> Example:
> 1. datatable has 100 rows, scroller shows 10 rows
> 2. I jump to page 5
> ... everything is fine
> After this the data changes ... the datatable has now 5 rows
> And now the problem comes out: The pageIndex of the scrollerComponent is still on page 5 ... and ... there is no data. When I jump to page 1 manually (by rewind-button) the data shows up on the first page.
> I tried all the examples with this combination and got allways the same situation. So, I think it could be a bug ...

-- 
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: (MYFACES-259) datatable, datascroller problem with mbean in session scope

Posted by "Stephan (JIRA)" <my...@incubator.apache.org>.
     [ http://issues.apache.org/jira/browse/MYFACES-259?page=comments#action_66597 ]
     
Stephan commented on MYFACES-259:
---------------------------------

I forgot one thing. In this testcase it is not neccessary to have a bean in session scope. My current faces-config is: 

    <managed-bean>
        <managed-bean-name>scrollerList</managed-bean-name>
        <managed-bean-class>my.tests.DatatableTestBean</managed-bean-class>
        <managed-bean-scope>request</managed-bean-scope>
    </managed-bean> 

If you have any questions for this issue, please contact me. 

> datatable, datascroller problem with mbean in session scope
> -----------------------------------------------------------
>
>          Key: MYFACES-259
>          URL: http://issues.apache.org/jira/browse/MYFACES-259
>      Project: MyFaces
>         Type: Bug
>     Versions: 1.0.9 beta
>     Reporter: Stephan
>  Attachments: DatatableTestBean.java, HitBean_snippet.java, dataScroller.jsp, hitlist_snippet.jsf, output.txt
>
> I have a MBean in session scope, which holds the data for the datatable. 
> The scroller for the table works fine, when I use it once or the rowCount of data never changes. But I get in trouble when I change the page of the scroller and change the rowCount.
> Example:
> 1. datatable has 100 rows, scroller shows 10 rows
> 2. I jump to page 5
> ... everything is fine
> After this the data changes ... the datatable has now 5 rows
> And now the problem comes out: The pageIndex of the scrollerComponent is still on page 5 ... and ... there is no data. When I jump to page 1 manually (by rewind-button) the data shows up on the first page.
> I tried all the examples with this combination and got allways the same situation. So, I think it could be a bug ...

-- 
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: (MYFACES-259) datatable, datascroller problem with mbean in session scope

Posted by "Stephan (JIRA)" <my...@incubator.apache.org>.
     [ http://issues.apache.org/jira/browse/MYFACES-259?page=comments#action_66596 ]
     
Stephan commented on MYFACES-259:
---------------------------------

I just played around to see where problem really occurs. I could define a better testcase in the files dataScroller.jsp and DatatableTestBean.java.

Explanation for this testcase: 

When I change the page of datascroller and come back a second time with a rowcount, that is to small to reach that page, I get an empty table. Expected result, would be a page, that shows at least last elements of the resultset.

You can see the mistake, by refreshing the page datascroller.jsp a couple of times, change the page in the scroller and refresh again a couple of times.

You will get results like this:

15 hits, hits 81 - 15. page 9 / 2
23 hits, hits 41 - 23. page 5 / 3
5 hits, hits 21 - 5. page 3 / 1

As you can see the current page is out of the maximum page size.

> datatable, datascroller problem with mbean in session scope
> -----------------------------------------------------------
>
>          Key: MYFACES-259
>          URL: http://issues.apache.org/jira/browse/MYFACES-259
>      Project: MyFaces
>         Type: Bug
>     Versions: 1.0.9 beta
>     Reporter: Stephan
>  Attachments: DatatableTestBean.java, HitBean_snippet.java, dataScroller.jsp, hitlist_snippet.jsf, output.txt
>
> I have a MBean in session scope, which holds the data for the datatable. 
> The scroller for the table works fine, when I use it once or the rowCount of data never changes. But I get in trouble when I change the page of the scroller and change the rowCount.
> Example:
> 1. datatable has 100 rows, scroller shows 10 rows
> 2. I jump to page 5
> ... everything is fine
> After this the data changes ... the datatable has now 5 rows
> And now the problem comes out: The pageIndex of the scrollerComponent is still on page 5 ... and ... there is no data. When I jump to page 1 manually (by rewind-button) the data shows up on the first page.
> I tried all the examples with this combination and got allways the same situation. So, I think it could be a bug ...

-- 
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] Updated: (MYFACES-259) datatable, datascroller problem with mbean in session scope

Posted by "Stephan (JIRA)" <my...@incubator.apache.org>.
     [ http://issues.apache.org/jira/browse/MYFACES-259?page=all ]

Stephan updated MYFACES-259:
----------------------------

    Attachment: output.txt

some output generated by the bean and the jsf

> datatable, datascroller problem with mbean in session scope
> -----------------------------------------------------------
>
>          Key: MYFACES-259
>          URL: http://issues.apache.org/jira/browse/MYFACES-259
>      Project: MyFaces
>         Type: Bug
>     Versions: 1.0.9 beta
>     Reporter: Stephan
>  Attachments: HitBean_snippet.java, hitlist_snippet.jsf, output.txt
>
> I have a MBean in session scope, which holds the data for the datatable. 
> The scroller for the table works fine, when I use it once or the rowCount of data never changes. But I get in trouble when I change the page of the scroller and change the rowCount.
> Example:
> 1. datatable has 100 rows, scroller shows 10 rows
> 2. I jump to page 5
> ... everything is fine
> After this the data changes ... the datatable has now 5 rows
> And now the problem comes out: The pageIndex of the scrollerComponent is still on page 5 ... and ... there is no data. When I jump to page 1 manually (by rewind-button) the data shows up on the first page.
> I tried all the examples with this combination and got allways the same situation. So, I think it could be a bug ...

-- 
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: (MYFACES-259) datatable, datascroller problem with mbean in session scope

Posted by "Stephan (JIRA)" <my...@incubator.apache.org>.
    [ http://issues.apache.org/jira/browse/MYFACES-259?page=comments#action_12317048 ] 

Stephan commented on MYFACES-259:
---------------------------------

Hi Mathias, 

could you please explain, what you mean with 'set the first attribute of the datatable to a meaningfull value'?

thanks in advance
Stephan

> datatable, datascroller problem with mbean in session scope
> -----------------------------------------------------------
>
>          Key: MYFACES-259
>          URL: http://issues.apache.org/jira/browse/MYFACES-259
>      Project: MyFaces
>         Type: Bug
>     Versions: 1.0.9 beta
>     Reporter: Stephan
>     Assignee: Mathias Broekelmann
>  Attachments: DatatableTestBean.java, HitBean_snippet.java, dataScroller.jsp, hitlist_snippet.jsf, output.txt
>
> I have a MBean in session scope, which holds the data for the datatable. 
> The scroller for the table works fine, when I use it once or the rowCount of data never changes. But I get in trouble when I change the page of the scroller and change the rowCount.
> Example:
> 1. datatable has 100 rows, scroller shows 10 rows
> 2. I jump to page 5
> ... everything is fine
> After this the data changes ... the datatable has now 5 rows
> And now the problem comes out: The pageIndex of the scrollerComponent is still on page 5 ... and ... there is no data. When I jump to page 1 manually (by rewind-button) the data shows up on the first page.
> I tried all the examples with this combination and got allways the same situation. So, I think it could be a bug ...

-- 
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: (MYFACES-259) datatable, datascroller problem with mbean in session scope

Posted by "Mathias Broekelmann (JIRA)" <my...@incubator.apache.org>.
    [ http://issues.apache.org/jira/browse/MYFACES-259?page=comments#action_12317052 ] 

Mathias Broekelmann commented on MYFACES-259:
---------------------------------------------

that´s a tricky issue ...

First of all it´s a datatable issue. The datatable.first attribute is used to determine at which element of the datamodel the rows start.
The datascroller has no chance to manipulate the datatable.first between jsf invoke application and encode phase of the datatable in which the change of the rowcount happens. So we have to handle this in the datatable. 

I see two options for the datatable if the first value is greater than the rowcount:

- leave first as it is which is implemented now
- set first to 0 which may have side effects if your want to have a different behavior. That´s the reason why it is not implemented

You could define your own datatable renderer which only implements encodeBegin() and checks if the first value is greater than the rowcount value and set first to a different value.

If you have any suggestions how we could do it more generally please let me now.

> datatable, datascroller problem with mbean in session scope
> -----------------------------------------------------------
>
>          Key: MYFACES-259
>          URL: http://issues.apache.org/jira/browse/MYFACES-259
>      Project: MyFaces
>         Type: Bug
>     Versions: 1.0.9 beta
>     Reporter: Stephan
>     Assignee: Mathias Broekelmann
>  Attachments: DatatableTestBean.java, HitBean_snippet.java, dataScroller.jsp, hitlist_snippet.jsf, output.txt
>
> I have a MBean in session scope, which holds the data for the datatable. 
> The scroller for the table works fine, when I use it once or the rowCount of data never changes. But I get in trouble when I change the page of the scroller and change the rowCount.
> Example:
> 1. datatable has 100 rows, scroller shows 10 rows
> 2. I jump to page 5
> ... everything is fine
> After this the data changes ... the datatable has now 5 rows
> And now the problem comes out: The pageIndex of the scrollerComponent is still on page 5 ... and ... there is no data. When I jump to page 1 manually (by rewind-button) the data shows up on the first page.
> I tried all the examples with this combination and got allways the same situation. So, I think it could be a bug ...

-- 
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] Updated: (MYFACES-259) datatable, datascroller problem with mbean in session scope

Posted by "Stephan (JIRA)" <my...@incubator.apache.org>.
     [ http://issues.apache.org/jira/browse/MYFACES-259?page=all ]

Stephan updated MYFACES-259:
----------------------------

    Attachment: HitBean_snippet.java

code snippet how the table is created

> datatable, datascroller problem with mbean in session scope
> -----------------------------------------------------------
>
>          Key: MYFACES-259
>          URL: http://issues.apache.org/jira/browse/MYFACES-259
>      Project: MyFaces
>         Type: Bug
>     Versions: 1.0.9 beta
>     Reporter: Stephan
>  Attachments: HitBean_snippet.java, hitlist_snippet.jsf
>
> I have a MBean in session scope, which holds the data for the datatable. 
> The scroller for the table works fine, when I use it once or the rowCount of data never changes. But I get in trouble when I change the page of the scroller and change the rowCount.
> Example:
> 1. datatable has 100 rows, scroller shows 10 rows
> 2. I jump to page 5
> ... everything is fine
> After this the data changes ... the datatable has now 5 rows
> And now the problem comes out: The pageIndex of the scrollerComponent is still on page 5 ... and ... there is no data. When I jump to page 1 manually (by rewind-button) the data shows up on the first page.
> I tried all the examples with this combination and got allways the same situation. So, I think it could be a bug ...

-- 
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