• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
ERD2W ListExcel* with child records question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

ERD2W ListExcel* with child records question


  • Subject: ERD2W ListExcel* with child records question
  • From: Markus Ruggiero <email@hidden>
  • Date: Thu, 26 Jan 2012 21:17:28 +0100

Question about Excel Listings and how to get the data into them....

Model: StatementGroup -one-2-many- Statements

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?

Thanks for any help
---markus---


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Prev by Date: Re: Webobjects vulnerability to cross-site request forgery?
  • Next by Date: Re: Maven: archetypes, infrastructure, and documentation
  • Previous by thread: Re: Webobjects vulnerability to cross-site request forgery?
  • Next by thread: Re: On Topic Humor
  • Index(es):
    • Date
    • Thread