1

As told here Efficient JSF Pagination this is the best implementation when you have to show data from DB.

I'm going to implement a solution based on this http://hrycan.com/2012/03/28/primefaces-lazy-loading-datatable-for-jsf2/

lazy loading uses

public List<Record> load(int first, int pageSize, String sortField, SortOrder sortOrder, Map<String,String> filters) { .....

I like to implement this situation

  • Form with one field per col
  • A search button
  • A data table that will be updated when search is pressed, but use the filters indicated in form field.

Is this possible and how to manage external filters(not in data table)??. ??


|------------------------------------------------------------|
|                                                            |
|Form with a lot of field more or less 1 for each column.    |
|                                                            |
|Serch button ; reset button                                 |
|                                                            |
|------------------------------------------------------------|
|                                                            |
|            Data table with pagination                      |
|------------------------------------------------------------|

Community
  • 1
  • 1
user1594895
  • 587
  • 1
  • 10
  • 31
  • You should rework your question. – Jens Apr 30 '13 at 09:17
  • @Jens is now a bit more clear? – user1594895 Apr 30 '13 at 10:10
  • I still don't get where you differ from the example? The example seems to do what you want? So what are you asking for? – Jens Apr 30 '13 at 12:01
  • You don't need lazy loading in first line. – Danubian Sailor May 29 '13 at 14:53
  • @ŁukaszLech why? If my search return 100 results I prefer a pagiantion of 10 of them at time. Or i'm missing something. – user1594895 May 29 '13 at 15:36
  • You don't need lazy loading for pagination. Those are 2 separate mechanisms. – Danubian Sailor May 29 '13 at 16:47
  • @ŁukaszLech in lazy loading i have public List load(int first, int pageSize but in normal pagination i have getCars(). – user1594895 May 30 '13 at 07:12
  • @ŁukaszLech but the focus of my question is to use the filters in a separate form, when search is pressed i need to update the filters. I have implemented a possible ide but it has some problems http://stackoverflow.com/questions/16811286/setter-of-managed-bean-not-called – user1594895 May 30 '13 at 07:16
  • Filters in separate form are just the normal input texts, on click you can filter the collection bound directly to the datatable, so really there's no need to use LazyDataModel, since all lazy loading is done externally – Danubian Sailor May 30 '13 at 07:28

0 Answers0