Details
-
Type:
New Feature
-
Status:
Resolved
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: x.x
-
Component/s: DSL for Presentation
-
Labels:None
-
Number of attachments :
Description
Something like:
public class SortableComestibleDataProvider extends SortableDataProvider<ComestibleDto> { private static final Log log = LogFactory.getLog(SortableComestibleDataProvider.class); @SpringBean private BreakfastLocalService service; public SortableComestibleDataProvider(BreakfastLocalService service) { this.service = service; // set default sort setSort("name", true); } @SuppressWarnings("unchecked") public Iterator iterator(int first, int count) { SortParam sp = getSort(); return service.listComestibles(first, count, sp.getProperty()).iterator(); //return service.listComestibles(first, count).iterator(); } public IModel<ComestibleDto> model(ComestibleDto object) { final Long id = (object).getId(); return new LoadableDetachableModel<ComestibleDto>() { @Override protected ComestibleDto load() { return service.readComestibleAsComestibleDto(id); } }; } public int size() { return (int) service.countComestibles(); } public void detach() { } }
Is part of http://jira.codehaus.org/browse/MODFORJ-178