Re: WODisplayGroup and insert
Re: WODisplayGroup and insert
- Subject: Re: WODisplayGroup and insert
- From: Daniel Muller <email@hidden>
- Date: Mon, 6 Jan 2003 11:26:54 +0100
Use the insertion functions found in the WODisplayGroup class as:
public void insertObjectAtIndex(Object createObject, int newIndex)
otherwise you have to manually refetch your objects.
Hope this helps,
Daniel
--
On 06.01.2003, at 11:07, Antonio Moro wrote:
I've build two component, the first for listing products and the
second to
insert/edit a product.
The list is a WODisplayGroup and when I insert a new product and save
it, the
WODisplayGroup dosen't update.
Then if I recall the list from the Main component I can see the new
product.
My code for the new product action in list component is:
public DetailProductPage newRecord() {
DetailProductPage nextPage =
(DetailProductPage)pageWithName("DetailProductPage");
// Initialize your component here
EOEditingContext ec = this.session().defaultEditingContext();
product = new Product();
ec.insertObject( product );
nextPage.setProduct( product );
nextPage.setBackComponent( this );
return nextPage;
}
the code in detail component for save changes is:
public WOComponent saveRecord() {
EOEditingContext ec = this.session().defaultEditingContext();
ec.saveChanges();
return backComponent();
}
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.