I have multiple columns and use sortBy on all and filterBy on only one.On fresh page load sortBy does not work, clicking on header is ignored.However, if I enter a character into the filter, thereafter sorting works.The exact same problem was reported by somebody else here:.
This happens with data pulled from database by query, with reset per page load using. Where reset forces reloading of consumerBlocks used as dataTable rows: Code: Select all public void reset(). The dataTable uses consumerBlocks as rows and (at least) one filter thus. The consumerBlocks are only pulled from a database query via the getter when null (just after reset in page load). Where the actual database query is performed via an injected session bean blockQuery. Chrome 21.0.1180.90 Mac OS XIt is OK on Firefox 20.0 on Mac OS X 10.6.8 (both still supported). There are a number of very strange problems on Firefox 16.0.2 (which is end of line) on Mac OS X 10.5.8 (also end of line), such as the edit icons appearing as pen, tick, cross and row editing not activating at all, the sort icon not appearing, and on sorting the column headers explode and are repeated strangely offset to the right of all column headers. Row-editing worked fine with Primefaces 3.3 on Firefox 16.0.2 (which is end of line) on Mac OS X 10.5.8. On Mac OS X 10.5.8 row editing and sortBy are both ok on Safari 5.0.6 and also Chrome 21.0.1180.90. These tests were performed on Glassfish 3.1.1 (in Netbeans7.1). I can get the provided sample problem to sort properly (without the filterBy trick) if I do the following. I introduce a lazy holder for the Sample items, and use a simple List of Sample items in SampleController: Code: Select all. And in the p:dataTable I do not use the getAllSample() fetch fro database directly, which repopulates the entire time, I use the lazy getSampleList(). I appreciate fully that this approach has been recommended already by the Primefaces team here and elsewhere, and I use this approach in many circumstances in my complex real application. It was not working ok for me with Primefaces 3.3, it is working ok for Primefaces 3.5. However, I am still having sortyBy problems in many cases where, for example, I populate the p:dataTable with a derived list computed as a Transient list by a rich entity, but I need to isolate those in a suitable test case. EDIT: 2013-04-15 I investigated the problem further with an isolated test case and the problem was not the use of p:dataTable inside a composite component, it was because I was feeding a derived Transient list into the composite to populate the p:dataTable. I still dont understand why it does not work, because I am lazy loading correctly per ViewScoped the rich entity that computes the derived list. Please do not further discuss this matter in this forum posting here, it is now obsolete.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |