Re: Refreshing a Page
Re: Refreshing a Page
- Subject: Re: Refreshing a Page
- From: "Jonathan Fleming" <email@hidden>
- Date: Fri, 24 Jan 2003 01:52:26 +0000
From: Seejo Pylappan <email@hidden>
To: "Jonathan Fleming" <email@hidden>
CC: email@hidden, email@hidden
Subject: Re: Refreshing a Page
Date: Thu, 23 Jan 2003 19:27:33 -0500
Hi,
I have an NSMutableArray Array of objects which have a delete link in the
list, however, when i delete the object it remains in the list even after
a save to the database. When i look at the database (openBase) the object
has been deleted. It's only when I click on the object that I had
originally deleted that it disappears or if I use the refresh button on
the browser.
How are you deleting it? do you click the link, which is bound to a method
which deletes its and then returns the page?
public WOComponent deleteReferer() {
if ( this.canSafelyPerformAction( "deleteReferer" ) ) {
// get editing context from tbReferer object
EOEditingContext ec = tbRefererItem.editingContext();
// delete tbReferer from its editing context
ec.deleteObject(tbRefererItem);
// remove object from relationship
tbClient.removeObjectFromBothSidesOfRelationshipWithKey(tbRefererItem,
"tbReferers");
}
return this.backComponent();
}
You should also be deleting it from your array which is displayed. How are
you displaying the array?
the array is displayed as a list of a WORepetition, it is bound to:
tbClient.tbReferers //tbReferers is a toMany relationship of TbClient Class
tbRefererItem // item of the Class TbReferer
So, it seems that my answer to this problem would be to refresh the page
progmatically, however, I have tried to use both a refresh and refetch
method (below) to no avail:
refetch() - Method in class com.webobjects.eocontrol.EOEditingContext
Refetch in the database will not refresh the page. It will just refetch
from the db and update the eos in the editingcontext.
Yes, I was clutching at straws, just trying different things.
Sends editingContextWillSaveChanges messages to the this
EOEditingContext's editors, and invokes the invalidateAllObjects method.
refresh() - Method in class com.webobjects.woextensions.WOLongResponsePage
The WOLongResponsePage is used if you want are running a query on the db or
anything which would take a long time to complete it wont help you here.
What you need is the WOMetaRefresh component which you can set a interval
when the page would be refreshed.
But from what you have described, it looks like you are not properly
removing the object from your array to be displayed. More information on
what/where the delete happens would help.
-Seejo
I don't know If I have given you enough info here, but I hope you can deduce
the problem from what is here.
Thanks
Jonathan
_________________________________________________________________
It's fast, it's easy and it's free. Get MSN Messenger today!
http://messenger.msn.co.uk
_______________________________________________
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.