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 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