The component is pretty neat and all, but it only works if you're ordering a list of Strings. Fair enough, you can pass any collection to it and it will convert the elements to a String (through a converter or the toString() method). The problem that I have is that I'd like to order my list of objects that implement the Comparable interface. When I process the commandButton to get the ordered list, my original list goes from being List<MyObject> to List<String>. The weird thing is that it's declared as a list of MyObject. Primefaces is actually changing the type of my list. Weird.
Anyway, I understand the implications of enforcing only comparable objects in the component, but I think it would make the orderList much more powerful. Read a list from the DB, for example, order the elements using p:orderList, store the order back in the DB.
p:orderList for classes that implement comparable
-
- Prime
- Posts: 18616
- Joined: 05 Jan 2009, 00:21
- Location: Cybertron
- Contact:
OrderList support pojos not just string, for pojos you need a converter, component's responsibility not to sort your data but provide the UI for your users to sort it manually.
-
- Information
-
Who is online
Users browsing this forum: No registered users and 51 guests