Last active
December 31, 2015 14:59
-
-
Save uklance/8003728 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- page.tml --> | |
<t:grid source="myCustomGridDataSource" ... /> | |
// Page.java | |
public GridDataSource getMyCustomGridDataSource() { | |
final List<Document> docs = documentDAO.getAll(); | |
GridDataSource wrapper = new CollectionGridDataSource(docs) { | |
public int getAvailableRows() { | |
return super.getAvailableRows() + 1; | |
} | |
public Object getRowValue(int index) { | |
if (index < docs.size()) { | |
return super.getRowValue(index); | |
} | |
return new Document(); | |
} | |
}; | |
return wrapper; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment