Nevermind. I was casting it to WOComponent. Casting it to ERD2WListPage is what I wanted. So I end up with:
lpi.setDataSource(((ERD2WListPage) ERD2WUtilities.parentListPage(sender)).dataSource()); Which works perfectly! Dave On Oct 8, 2010, at 2:59 PM, David Avendasora wrote: > Hi Ramsey! > > Okay, so how do I get the EODataSource from the resulting ListPageInterface? > > Dave > > On Oct 8, 2010, at 2:12 PM, Ramsey Gurley wrote: > >> ERD2WUtilities.parentListPage(sender) should give you the next list page up >> for the sender even if the sender is nested. >> >> Ramsey >> >> On Oct 8, 2010, at 1:56 PM, David Avendasora wrote: >> >>> Hi all, >>> >>> I'm using the instructions here: >>> http://wiki.objectstyle.org/confluence/display/WO/D2W+Flow+Control to add a >>> function to my D2W listing page that will create and Excel file of the >>> objects listed. It works great, but I'm not comfortable with how I'm >>> getting the EODataSource from the existing page. Here's how I'm doing it >>> now: >>> >>> // "Export To Excel" >>> public WOActionResults exportToExcel(WOComponent sender) { >>> setSender(sender); >>> ListPageInterface lpi = (ListPageInterface) D2W.factory() >>> >>> .pageForConfigurationNamed("ListExcelCCCommunicationIdentity", >>> >>> sender().session()); >>> lpi.setDataSource((EODataSource) sender().parent() >>> >>> .valueForBinding("dataSource")); >>> lpi.setNextPage(sender()); >>> return (WOActionResults) lpi; >>> } >>> >>> the call to: .valueForBinding("dataSource") seems wrong since it depends >>> upon the parent of the ERDControllerButton to have the datasource, which is >>> not always true. >>> >>> What would be the proper way to get the dataSource? >>> >>> Dave >>> _______________________________________________ >>> Do not post admin requests to the list. They will be ignored. >>> Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) >>> Help/Unsubscribe/Update your Subscription: >>> http://lists.apple.com/mailman/options/webobjects-dev/ramsey%40xeotech.com >>> >>> This email sent to ram...@xeotech.com >> > > _______________________________________________ > Do not post admin requests to the list. They will be ignored. > Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) > Help/Unsubscribe/Update your Subscription: > http://lists.apple.com/mailman/options/webobjects-dev/webobjects%40avendasora.com > > This email sent to webobje...@avendasora.com
_______________________________________________ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com