onClose function
Description
Optional JavaScript to execute when the contents of a modern frame are hidden. This property is only available if the Has show/hide button property is checked.
Discussion
The onClose function defines the name of a JavaScript function to call when the frame is closed. The JavaScript can be defined in the Javascript functions section of the UX or in a Linked Javascript file.
For example, suppose the following function is defined in the Javascript functions for a UX Component:
var onFrameClose = function() { $svs('framename','Closed Frame'); }
The function sets the value of an element with id 'framename' to 'Closed Frame'.
In the UX Component, this function can be called when a modern frame with a show/hide button is closed to change the title of the Frame. Set the Frame label property to the following:
<span id="framename">Frame label</span>
Finally, set the onClose function property to the following:
onFrameClose
Now, when the user clicks the button to close the frame, the frame's label will be updated to read 'Closed Frame':
A similar function can be created to set the title that can be called by the onOpen function property.
See Also