• 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: Updating Nested To-Many Relationship
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Updating Nested To-Many Relationship


  • Subject: Re: Updating Nested To-Many Relationship
  • From: David Avendasora <email@hidden>
  • Date: Tue, 10 Apr 2007 07:52:14 -0500

Okay, I over-simplified the problem some. On the actual component, I'm not saving the changes to the database until the user clicks the "save" button. They _could_ save the changes after every change, but I want them to be able to revert, undo, and redo.

I don't really understand how I can tell a object to update, setting relationships and such, yet when I ask WO to display the object after the update, it shows an old version. If I had two different EOEditingContexts I could see them getting out of sync, but I am only using the Default EditingContext.

I've read the wiki on keeping EditingContexts fresh, but it seems all the tips relate to data in the DB changing and making sure the EC gets updated. I'm not even worried about what the DB says right now, I'm wondering why the changes I just made to an object are not reflected when I call it the next time.

Dave

On Apr 9, 2007, at 10:03 AM, Zak Burke wrote:

David Avendasora wrote on 4/5/07 2:32 PM:
I want to allow the user to move a RSComponent from one RoutingStep to another. I present the user with a WOPopUpButton on each rsComponent of all the RoutingSteps and they can simply pick which one they want it in. It does update everything properly, but when the page comes back, layout-wise the RSComponent is still in the original RoutingStep, but in the database it is in the new RoutingStep (right where it's supposed to be).
Why would the update be done properly, but the page not be fully updated with the changes?

Because EOF loves its cache. Loves it, loves it, loves it. IMNSHO, caching should be OFF by default because it's behavior is so confusing: you run an update, see the changes in the DB, then run a query and ... see no changes in the UI. WTF?


At any rate, try the following:

    // assuming you construct a fetch-spec "f"
    EOFetchSpecification f = new EOFetchSpecification(...);
    f.setRefreshesRefetchedObjects(true);

and see if your UI gets properly updated.

Don't get me wrong, WO's cache handling is top-notch. But having values cached when you haven't explicitly asked for that behavior is downright confusing the first time you encounter it.

zak.



_______________________________________________ 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: Updating Nested To-Many Relationship
      • From: David Avendasora <email@hidden>
References: 
 >Updating Nested To-Many Relationship (From: David Avendasora <email@hidden>)

  • Prev by Date: Re: Submitting multiple instances in one WOForm
  • Next by Date: Re: Submitting multiple instances in one WOForm
  • Previous by thread: Re: Updating Nested To-Many Relationship
  • Next by thread: Re: Updating Nested To-Many Relationship
  • Index(es):
    • Date
    • Thread