• 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: didUpdate?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: didUpdate?


  • Subject: Re: didUpdate?
  • From: Vinny Luc <email@hidden>
  • Date: Sun, 29 Jul 2012 11:35:44 -0400

Hi Ted,

I 've done similar thing in my app where i captured data changes/updates over to a third-party vendor.  The main flow is you save off the updated data on EditingContextWillSaveChanges event notification and do your DIFF on EditingContextDidSaveChanges event.

-Vinny


Message: 2
Date: Sat, 28 Jul 2012 23:03:21 -0700 (PDT)
From: Theodore Petrosky <email@hidden>
To: Tim Worman <email@hidden>
Cc: "email@hidden" <email@hidden>
Subject: Re: didUpdate?
Message-ID:
        <email@hidden">email@hidden>
Content-Type: text/plain; charset=iso-8859-1

@Override
public void willUpdate() {
   NSDictionary diffs = this.changesFromSnapshot(this.
editingContext().committedSnapshotForObject(this));

   NSLog.out.appendln("  willUpdate()  diffs    " + diffs);
}

the log shows the attributes that were updated AFTER the saveChanges() is called.

i am getting tired but I think this is harder than I was originally thinking.

I am on a d2w edit page. I change the values of some attributes and press the save button. it seems to me I need to do something when I press the edit EO button. I need to create a copy of the original EO to compare against. so that when the EO is actually saved, I can read that dictionary of the original EO.

then in my didUpdate() method I could create the email that includes the values of the original EO and the new updated values.


--- On Sat, 7/28/12, Tim Worman <email@hidden> wrote:

> From: Tim Worman <email@hidden>
> Subject: Re: didUpdate?
> To: "Theodore Petrosky" <email@hidden>
> Cc: "Paul Yu" <email@hidden>, "email@hidden" <email@hidden>
> Date: Saturday, July 28, 2012, 11:49 PM
> This is in the
> API for ERXGenericRecord. Have you tried it?
> changesFromCommittedSnapshotpublic
> NSDictionary<String,Object>
> changesFromCommittedSnapshot()Description copied from
> interface: ERXEnterpriseObjectComputes
> the current set of changes that this object has from the
> currently committed snapshot.
> Specified
> by:changesFromCommittedSnapshot in
> interface ERXEnterpriseObjectReturns:a
> dictionary holding the changed values from the currently
> committed snapshot.
> TimUCLA GSE&IS
> On Jul 28, 2012, at 7:36 PM, Theodore Petrosky
> <email@hidden>
> wrote:
> Are you thinking that in the willUpdate() method
> I should have access to the attributes before they are
> changed?
>
> or that I should do something in this method because I just
> tested it with a log statement and the attributes are
> already changed.
>
> this would have been trivial in a regular wonder app. but I
> am forcing myself to stay in D2W.
>
> --- On Sat, 7/28/12, Paul Yu <email@hidden>
> wrote:
>
> From: Paul Yu <email@hidden>
> Subject: Re: didUpdate?
> To: "Theodore Petrosky" <email@hidden>
> Cc: "email@hidden"
> <email@hidden>
> Date: Saturday, July 28, 2012, 10:06 PM
> willUpdate()?
>
> Sent from my iPad
>
> On Jul 28, 2012, at 9:03 PM, Theodore Petrosky <email@hidden>
> wrote:
>
> So, I got my D2W app sending email
> when I update or
> create a new object by overriding didUpdate in
> the EO.
>
> basically, my email says "This record has been
> updated"
> and here are the attributes.
>
> How can I get a copy of the original. I mean, I want
> the email to say:
>
> here is the old title: Big title.
> Here is the new title: New title.
>
> Where can I get a copy of the EO before it gets
> updated?
>
> Ted
> _______________________________________________
> 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
>
>
>  _______________________________________________
> 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
>
 _______________________________________________
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: didUpdate?
  • Next by Date: Re: didUpdate?
  • Previous by thread: Re: didUpdate?
  • Next by thread: Re: didUpdate?
  • Index(es):
    • Date
    • Thread