-
1. Re: data:table Easiest way to propagate Sorting to the EL-bo
ilya_shaikovsky Oct 12, 2009 6:30 AM (in response to christian_koelle)you should implement the dataModel properly as it shown at modifiable model sample tab at richfaces-demo (dataTable page).
-
2. Re: data:table Easiest way to propagate Sorting to the EL-bo
christian_koelle Oct 12, 2009 10:35 AM (in response to christian_koelle)Thanks for your quick reply.
I tried the following:- I implemented a GenericListDataProvider which implements DataProvider[T]
- I used a ExtendedTableDataModifiableModel which uses the GenericListDataProvider.
It works somehow in an unwanted way. I still do not fully understand the concept.
Originally I bound a List of MyObjetct-instances to the the table, somehow like:<rich:dataTable value="#{[EL-String pointing to ArrayList<MyObect> in a session-scoped bean]}" sortMode="single" bypassUpdates="false" rows="5" var="row"
As I said before: The only feature missing was, that the sorting was not propagated to the original list ArrayList[MyObject].
Now: I intend not to replace the ArrayList in be backingBean by the implementention of ExtendedTableDataModifiableModel as I do not want to have uses-dependencies to RichFaces-Components in that class. Nevertheless I might be prepared to change my philosophy.
So far so good: Now I have a table definition like this:<rich:dataTable value="#{EL-String pointing to ExtendedTableDataModifiableModel<MyObect> in a session scoped bean}" sortMode="single" bypassUpdates="false" var="row"
The problems I have with that approach are- that clicking on the sortable headers is visually doing anything except for flipping the sort-icons..
- If I update the list of MyObject-Instances within my datamodell, I have to call reset().
- The DataProvider functions are only called once.
So, I do not know, whether I am on the right track. Might it be a solution to make my ExtendedTableDataModifiableModel a request-scoped bean? The session scope might be responsible for the fact that the DataProvider-Functions are only called once.
-
3. Re: data:table Easiest way to propagate Sorting to the EL-bo
konstantin.mishin Oct 13, 2009 9:12 AM (in response to christian_koelle)I cannot understand, why you use ExtendedTableDataModifiableModel. This model is used in ExtendedTableData. I have found bug in our description (https://jira.jboss.org/jira/browse/RF-7978). Maybe, it was case of misunderstanding. So your model class should extend ExtendedDataModel and additionally implement Modifiable interface. I think, that sources of org.richfaces.demo.modifiableModel.BaseModifiableHibernateDataModel will be useful for you.
-
4. Re: data:table Easiest way to propagate Sorting to the EL-bo
christian_koelle Oct 13, 2009 1:06 PM (in response to christian_koelle)Thank you very much for your support: Problem solved.
In addition to the misunderstanding, I lost the original list-reference during page action. This is now fixed. And I think I finally understand the concept.
I finally found the BaseModifiableHibernateDataModel sources and will take a look into it soon.
Thanks and Regards
Chris