myfaces-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alessandro Polverini (JIRA)" <incubator-...@incubator.apache.org>
Subject [jira] Created: (MYFACES-115) x:dataTable and x:pageScroller not always working fine together
Date Thu, 03 Mar 2005 15:16:56 GMT
x:dataTable and x:pageScroller not always working fine together
---------------------------------------------------------------

         Key: MYFACES-115
         URL: http://issues.apache.org/jira/browse/MYFACES-115
     Project: MyFaces
        Type: Bug
    Versions: Nightly Build    
 Environment: tomcat 5.0.28
    Reporter: Alessandro Polverini


This is an excerpt from myfaces-dev discussion between me and others.
I post it here so it does not get lost.
The objective is to use a x:dataScroller to browse throug a x:dataTable with a request scope
backing bean.

---
I tried to set preserveDataModel to true to avoid the x:saveState declaration, but this would
not work (in my case, at least).

I try to explain my situation to better understand the behaviour: I have a simple form with
some search parameters, when the user submits it, the backing bean (request scope) is populated
with results and I show and paginate through them using x:dataTable and x:dataScroller.

The only way I found to make it work well is:
- set preserveDataModel to false (or to not put the attribute completely)
- use a x:saveState on #{bean.results}

Whithout doning this, I can see only the first page of results and every other action (for
example switch to page #2) the datas are lost and no more rows are displayed.
The problem also occurs if I *both* use saveState and preserveDataModel, maybe because the
partially conflicts in their operation?

So, I deduce that preserveDataModel does not the very same thing of saveState, and maybe the
idea of Sean (see MYFACES-98) is useful anyway?

Or maybe preserveDataModel has a bug (or a limitation) and should be fixed?

I would be interested to better understand this issue.

---

I don't think there's a bug in the implementation of preserveDataModel.
It's quite understandable that if you are using pageScroller together with the dataTable,
you have to take care of saving the data yourself.
Of course, pageScroller could have its own preserveDataModel or something similar, but if
it's used the dataTable shouldn't anymore be responsible of saving the data. Maybe pagescroller
could generate a warning if preserveDataModel is set to true in the data table or handle "remembering"
the data or some other better implementation, but I don't see even the current implementation
as a bug.

---

> I don't understand well why preserveDataModel should not work 
> if used with pageScroller. PageScroller is just a "normal" 
> component providing pagination, what would differ if I 
> implement it in my program instead of using it?
> What I mean is: if the array is correctly restored for my 
> application, why it should not work for pageScroller?

Oh, the reason is simple. Since the preserveDataModel saves only what the dataTable displays,
and pageScrollers divides the data into multiple pages, preserveDataModel happily remembers
only the results displayed on the first page.
 
> Anyway, since they both are myfaces components, I expect them 
> to correctly work together so a warning or something similar 
> in the documentation would be welcome.

I 100% agree with you there. Even better, pageScroller could "take over", force the preserveDataModel
in the datatable to reset to false and/or have its own preserveDataModel.

-- 
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
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


Mime
View raw message