Help with SharedEditingContext...
Help with SharedEditingContext...
- Subject: Help with SharedEditingContext...
- From: LD <email@hidden>
- Date: Fri, 15 Jul 2005 15:27:33 +1000
Hi all,
A little long - but hopefully someone in the know is patient ;-)
I've recently and cautiously ventured down the track of incorporating
EOSharedEditingContext into my project. I've done the usual research,
including reading through the list archives - especially the thread
titled "Re: EOSharedEditingContext question" in Feb 2005. Anyway,
I've hit a snag that I can't seem to overcome (yet). It should be
something simple...
Previously, in my Session I was fetching some objects into the
defaultEditingContext and when editing a particular
EOEnterpriseObject I was creating a child editing context and getting
a local instance of the object to adjust. No worries with that.
However, now I'm fetching into the EOSharedEditingContext in main -
no problems there, but when I get local instances of those objects in
a editing context for a page, a few objects are mysteriously missing.
e.g., when I return an EditProduct component from another component's
action, a product category list is no longer available from the pop-
up. All worked fine before. The basic set up was as follows... if
anyone has any ideas that'd be great. Cheers.
CategoryPopUpButton: WOPopUpButton {
list = productCategories;
selection = product.productCategory;
noSelectionString = "-- no product category --";
displayString = aProductCategory.name;
item = aProductCategory;
}
It's the 'productCategories' that are coming up blank... but are
showing up in the previous component.
public class LDComponent extends WOComponent {
// LDEditingContext incorporates some useful methods from
EOUtilities among other things
protected LDEditingContext _pageEditingContext;
<...>
public LDComponent(WOContext context) {
super(context);
<...>
_pageEditingContext = new LDEditingContext((LDEditingContext)
session().defaultEditingContext());
_pageEditingContext.setSharedEditingContext(null);
}
public EOEnterpriseObject createAndInsertInstance(String entity)
{...}
public EOEnterpriseObject localInstanceOfObject
(EOEnterpriseObject eo) {...}
public NSArray localInstancesOfObjects(NSArray eos) {...}
<...>
}
-- EditProduct.java --
public EditProduct extends LDComponent {
<...>
public void setProduct(Product newProduct) {
theProduct = (Product) localInstanceOfObject(newProduct);
}
public Product product() {
if (theProduct == null) {
theProduct = (Product) createAndInsertInstance("Product");
}
return theProduct;
}
public void setProductCategory(ProductCategory
newProductCategory) {
ProductCategory lpc = (ProductCategory) localInstanceOfObject
(newProductCategory);
product().setProductCategory(lpc);
}
// bound to pop-up menu "selection"
public ProductCategory productCategory() {
return product().productCategory();
}
// bound to pop-up menu "list"
public NSArray productCategories() {
if (productCategories == null) {
productCategories = localInstancesOfObjects
(_session.productCategories());
}
return productCategories;
}
<...>
}
with regards,
--
LD
_______________________________________________
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