destroyAdded by IBM on October 10, 2012 | Version 1 (Original)
|Destroys (or deletes) specified elements from a form, including box, button, check, combobox, field, labels, line, list, pages, popup, radio, and spacer.
You can use the destroy function to remove fields that are no longer relevant, based on information entered elsewhere on the form. In effect, this function permits you to dynamically customize the form for the user, which reduces the possibility of users entering inaccurate or unnecessary information. When a compute within the destroy function causes a change to the form, the form checks for other computes referenced by the destroy function and evaluates them immediately.
For example, a form could include a check box indicating whether a person's mailing address is the same as the billing address. When the user selects this check box, the destroy function could be called to dynamically delete all items pertaining to the mailing address.
Table 1. destroy parameters
For a list of nodes that can be deleted using destroy, see Destroy function quick reference.
|reference||Reference string||A reference to the element you want to destroy.|
|type||String||The type of element being destroyed. Valid types are page, item, or option.|
Returns Nothing if the operation was successful, or an error message if the reference cannot be destroyed.
Example This example creates a button that, when clicked by the user, deletes "FIELD1" from "PAGE2" of the form.
"toggle(activated, 'off', 'on') == '1' ?
destroy('PAGE2.FIELD1', 'item') : ''"></custom:destroy>