Customer wants on pageConfiguration = "ListStatementGroup" an Excel link to download a group listing. That is easy, I have this kind of thing working all over my app. But now the customer wants the Statements listed under the StatementGroup. So what the customer actually wants is not ListExcelStatementGroup but ListExcelStatement for all the selected groups. Any good ideas?
I currently use the following code for all my Excel download links (bound to a belowDisplayPropertyKey on several of the List* pageConfigurations)
public WOActionResults downloadExcel() {
ERD2WListPage parentListPage = parentListPage();
if (parentListPage != null) {
EODataSource dataSource = parentListPage.displayGroup().dataSource();
D2WContext d2wContext = parentListPage.d2wContext();
String entityName = (String)d2wContext.valueForKeyPath( "entity.name" );
d2wContext.takeValueForKey(d2wContext.valueForKey("entity.name") + ".xls", "excelFileName");
ListPageInterface lpi = (ListPageInterface)D2W.factory().pageForConfigurationNamed( "ListExcel" + entityName, session() );
lpi.setDataSource( dataSource );
lpi.setNextPage( this.context().page() );
return (WOActionResults)lpi;
}
return null;
}
I think I need to create a new dataSource for the Statements and qualify it with the dataSource from the parentListPage. How would I do this? Do I have to do this manually or is there some simple way calling the right methods? Or is there an altogether different and better way?