Hi there,

your problem seems to be quite simple. See below.

On 16/01/2008, at 5:12 PM, Yung-Luen Lan wrote:

========================
    protected Sale sale;
        private NSArray saleRecords;

    public NSArray sales() {
        // keep the list of records consistent by keeping them in memory.
        if (saleRecords == null) {
saleRecords = EOUtilities.objectsForEntityNamed(theSession ().defaultEditingContext(), "Sale");
                
/* Filter the array with some EOQualifier.filteredArrayWithQualifier (sales, EOQualifier), snip */

EOSortOrdering sort = EOSortOrdering.sortOrderingWithKey("created", EOSortOrdering.CompareDescending ); saleRecords = EOSortOrdering.sortedArrayUsingKeyOrderArray(sales, new NSArray(sort));
        }
    }

    public WOComponent download()
    {
        MyDownloader n = (MyDownloader)pageWithName("MyDownloader");
        n.setFile(sale.file());
        n.setFilename(sale.canonicalFileName());
        return n;
    }

        /** Add a refresh action to your page to update the list */
        public WOComponent refresh()
        {
                saleRecords = null;
                return this;
        }

}

with regards,
--

Lachlan Deck

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to