• 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
Re: How to avoid wrong mapping after new object inserted
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to avoid wrong mapping after new object inserted


  • Subject: Re: How to avoid wrong mapping after new object inserted
  • From: "Yung-Luen Lan" <email@hidden>
  • Date: Wed, 16 Jan 2008 17:12:33 +0800

Hi,

Thanks for Lachlan's response. But I'm a little bit confused.

Does that mean I have to add a button, says, "Refresh the sales," to invoke the refresh action? Or can I just use the refresh button on my browser to do that?

Thanks for the help.

Regards,
yllan


On Jan 16, 2008 3:36 PM, Lachlan Deck <email@hidden> wrote:
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.
 _______________________________________________
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

  • Follow-Ups:
    • Re: How to avoid wrong mapping after new object inserted
      • From: Lachlan Deck <email@hidden>
References: 
 >How to avoid wrong mapping after new object inserted (From: "Yung-Luen Lan" <email@hidden>)
 >Re: How to avoid wrong mapping after new object inserted (From: Lachlan Deck <email@hidden>)

  • Prev by Date: WO5.4 DTW NSMutableArray ClassCastException
  • Next by Date: Re: How to avoid wrong mapping after new object inserted
  • Previous by thread: Re: How to avoid wrong mapping after new object inserted
  • Next by thread: Re: How to avoid wrong mapping after new object inserted
  • Index(es):
    • Date
    • Thread