Re: EditingContext problem, ghost entry in datastore [ was Debuging WOManyToManyRelationship]
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