• 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
Local instance of EOF returning null
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Local instance of EOF returning null


  • Subject: Local instance of EOF returning null
  • From: Pascal Robert <email@hidden>
  • Date: Sun, 02 Oct 2011 19:32:45 -0400

I'm working on a page for WOWOC where potentials presenters could submit their papers (presentation suggestions). I'm using the HTML routing stuff from ERRest, so in my controller, I'm doing:

  public WOActionResults createPaperAction() throws Throwable {
    Member presenter = null;
    String tokenValue = this.request().cookieValueForKey("wowodcToken");
    if (tokenValue != null) {
      String username = crypter.decrypt(tokenValue);
      presenter = Member.fetchMember(editingContext(), Member.USERNAME.eq(username));
    }

    

    if (presenter != null) {
      Conference conference = Conference.fetchConference(editingContext(), Conference.NAME.eq("WOWODC 2012"));
      ConferenceSession newPresentation = ConferenceSession.createConferenceSession(editingContext(), conference);
      newPresentation.addToPresentersRelationship(presenter);
      PaperUpdate nextPage = pageWithName(PaperUpdate.class);
      nextPage.setConfSessionItem(newPresentation);
      return nextPage;        
    }
    return errorResponse(ERXHttpStatusCodes.STATUS_FORBIDDEN);
  }

And in the component:

  protected EOEditingContext editingContext() {
    if (_editingContext == null) {
      _editingContext = ERXEC.newEditingContext();
    }
    return _editingContext;
  }

  public void setConfSessionItem(ConferenceSession confSessionItem) {
    this._confSessionItem = ERXEOControlUtilities.localInstanceOfObject(editingContext(), confSessionItem);
  }

Problem is: localInstanceOfObject always returns null... unless that before I'm calling setConfSessionItem, if I call editingContext().saveChanges, now localInstanceOfObject. But I don't want to save the EO before moving to a new EC, so what is the recipe to move an EO to another EC when the EO have not been saved?
 _______________________________________________
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: Local instance of EOF returning null
      • From: Ramsey Gurley <email@hidden>
    • Re: Local instance of EOF returning null
      • From: Chuck Hill <email@hidden>
  • Prev by Date: Re: creating first framework
  • Next by Date: Re: Local instance of EOF returning null
  • Previous by thread: Re: creating first framework
  • Next by thread: Re: Local instance of EOF returning null
  • Index(es):
    • Date
    • Thread