• 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: EditingContext problem, ghost entry in datastore [ was Debuging WOManyToManyRelationship]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: EditingContext problem, ghost entry in datastore [ was Debuging WOManyToManyRelationship]


  • Subject: Re: EditingContext problem, ghost entry in datastore [ was Debuging WOManyToManyRelationship]
  • From: Chuck Hill <email@hidden>
  • Date: Tue, 26 Jul 2005 09:58:59 -0700

I'm not sure what  you don't understand.  :-)  This is the code I meant:

public WOComponent addOrUpdateProductGeneric()
{
awakeFromInsertionProductGeneric(ec); //setting the date posted/updated
if (!productGenericList.containsObject(productGeneric))
{
productGeneric.setStockStatus(new Integer(0));
}
else
{
editMode = false;
}
ec.saveChanges();


        // If we just created a new object and saved it,
        // reset object so that another new object will be created
        // for next time
        if (editMode) {
            setProductToBeEdited(null);
        }

        return context().page();
    }


Chuck

On Jul 23, 2005, at 9:20 AM, Dev WO wrote:


-----
public WOComponent addOrUpdateProductGeneric()
{
awakeFromInsertionProductGeneric(ec); //setting the date posted/updated
if (!productGenericList.containsObject(productGeneric))
{
productGeneric.setStockStatus(new Integer(0));
}
else
{
editMode = false;
}
ec.saveChanges();



Replace the code below with something like: // We just created a new object and saved it. // Reset page so that another new object will be created if (editMode) { setProductToBeEdited(null); }


        productGeneric = new ProductGeneric();
        ec.insertObject(productGeneric);
        productGeneric.setCommentaryAllowed(new Boolean(true));
        productGeneric.setIsAvailable(new Boolean(true));
        productGeneric.setSalesPrice(new Integer(0));
        return context().page();
    }



--
Practical WebObjects - a book for intermediate WebObjects developers who want to increase their overall knowledge of WebObjects, or those who are trying to solve specific application development problems.
http://www.global-village.net/products/practical_webobjects





_______________________________________________ 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: EditingContext problem, ghost entry in datastore [ was Debuging WOManyToManyRelationship]
      • From: Dev WO <email@hidden>
References: 
 >Debuging WOManyToManyRelationship (From: Dev WO <email@hidden>)
 >Re: Debuging WOManyToManyRelationship (From: Dev WO <email@hidden>)
 >Re: Debuging WOManyToManyRelationship (From: Chuck Hill <email@hidden>)
 >Re: Debuging WOManyToManyRelationship (From: Dev WO <email@hidden>)
 >Re: Debuging WOManyToManyRelationship (From: Chuck Hill <email@hidden>)
 >Re: Debuging WOManyToManyRelationship (From: Dev WO <email@hidden>)
 >EditingContext problem, ghost entry in datastore [ was Debuging WOManyToManyRelationship] (From: Dev WO <email@hidden>)
 >Re: EditingContext problem, ghost entry in datastore [ was Debuging WOManyToManyRelationship] (From: Chuck Hill <email@hidden>)
 >Re: EditingContext problem, ghost entry in datastore [ was Debuging WOManyToManyRelationship] (From: Dev WO <email@hidden>)

  • Prev by Date: Re: 10.4 and new File now longer works for uploading a file
  • Next by Date: Re: load testing
  • Previous by thread: Re: EditingContext problem, ghost entry in datastore [ was Debuging WOManyToManyRelationship]
  • Next by thread: Re: EditingContext problem, ghost entry in datastore [ was Debuging WOManyToManyRelationship]
  • Index(es):
    • Date
    • Thread