This project is read-only.

Is it possible to close tab automatically when an object displayed in that tab is deleted

Jan 28, 2014 at 2:53 PM
I have a scenario like this:

User opens an object in a tab. One of the action methods for this object is to delete this object. At the end of this method, it will return to a different object on another tab. But when user clicks back to the previous tab, it throws "Object reference not set to an instance of an object." error, which is obvious because the object is deleted from database.

I wonder how we can close the tab automatically when object is deleted, or some meaningful exception message should be displayed
Jan 28, 2014 at 4:14 PM
There is no way to automatically close the tab at the moment.

However what should happen with deleted objects is that any attempt to access them after deletion should raise an 'ObjectNotFound' exception. This should then cause the 'DestroyedError' view to be displayed (telling the user that he has attempted to access an object that had been deleted). I'll raise a ticket for this I think it probably relates to accessing the deleted object through the history rather than a stale reference.