On this Page

    domObj.deleteObject

    (Merge only) (As of 3.0.003.21)

    Delete an object and all of its descendants from the DOM tree.

    Syntax

    domObj.deleteObject()

    Returned Value

    True if successful, false otherwise. It will be false if the script would be deleting the object with which the script is associated, or by deleting any ancestor of that object.

    Description

    The most common thing to do when an object is determined to be not relevant to a document, presumably based on the data of the moment, is to make that object invisible. This goes further by actually deleting the object. Why delete an object? An invisible object still exists and still has an extent which will be taken into account when Merge works out the minimum height to which a containing Pane can be shrunk. If the object is not just invisible but deleted, then that containing Pane may be able to be shrunk to a lesser height. Note that a fresh DOM is created with each new document instance. The object deletion is for one document instance only.

    A script cannot delete the object to which it is attached. E.g. this.deleteObject(); will always fail. Nor can it delete an object that is an ancestor of itself.