From: Denis F. <de...@de...> - 2006-09-06 15:03:48
|
Hi, I'm experiencing problems using ERXBatchingDisplayGroup with fetchSpecification that has sortOrderings(). Here is my setup: 1. I create a ERD2WListPage: ((EODatabaseDataSource)ds).setFetchSpecification(fs); lpi.setDataSource(ds); 2. defaultSortOrdering in ERDirectToWeb rules is set to it's default value of "()". I do not override it. 3. useBatchingDisplayGroup is set to "true" in my rules 4. When displayGroup fetches objects I loose the sortOrderings set in fs (in eomodel) due to this code in ERXBatchingDisplayGroup.java: spec.setSortOrderings(sortOrderings()); (line 105) where sortOrderings() is displayGroup's sort orderings and it's equal to "()" since it is initialized from rules in setUp() code of ERD2WListPage. Since ignoring sortOrderings of fs sounds like a bad idea to me I suggest making the following changes: 1. Use sortOrderings of fs if sortOrderings in displayGroup are "()". 2. Make the default value of defaultSortOrdering in d2w.d2wModel of ERDirectToWeb equal to "null". This change is needed since if it is set to "()" the following code in setUp() will use use it to override the sortOrderings in fs anyway leading to lost fs sortOrderings again: if((sortOrderings != null) && (ds instanceof EODatabaseDataSource)) { EOFetchSpecification fs = ((EODatabaseDataSource)ds).fetchSpecification(); if(!fs.sortOrderings().equals(sortOrderings)) { fs.setSortOrderings(sortOrderings); _hasToUpdate = _hasToUpdate ? true : alwaysRefetchList(); } } Proposed patch is attached. --- Denis Frolov Design Maximum MA Tel: +7 863 2648211 Fax: +7 863 2645229 Web: http://www.designmaximum.com |