IBM BPM, V8.0.1, All platforms > Create processes in IBM Process Designer > Create user interfaces for business processes > Coach and Coach View reference information > Event handlers

The unload event handler

The unload function performs cleanup after the view has completed. The unload function is only called once during the lifecycle of the view.


Usage

Use the unload function to clean up resources before the view is removed. The binding handle is an example of such a resource. The binding handle is returned when bindAll() or bind() is invoked. You can release the binding in the unload event handler by calling handle.unbind().

For example, you have MyTableView in which users can select and deselect rows. You register listeners in load event handler of MyTableView using the following code:

this.connectHandles = [];
this.connectHandles.push(dojo.connect(..., "onSelected",...));
this.connectHandles.push(dojo.connect(..., "onDeselected",...));

In the unload event handler for MyTableView you , unregister the listeners:

Array.forEach(this.connectHandles, function(handle) {
  dojo.disconnect(handle);});


Parameters

The unload function does not take any parameters.

Event handlers


Related reference:
The load event handler
The view event handler
The change event handler
The collaboration event handler
The validate event handler
Binding data and configuration options