EmbeddedXopus.removeListener
When disposing of a component of your framework that contains Xopus (that has an event listener attached to EmbeddedXopus), it is best to remove the listener to prevent errors.
This can easily be done, as the following example shows. Make sure you supply the same name as the
function MyXMLInputComponent()
{
this.id = generateId();
this.api = null;
EmbeddedXopus.addListener(this, this.id);
// Hypothetical function that starts Xopus:
this.setupIFrame(this.id);
this.destructor = function () {
EmbeddedXopus.removeListener(this, this.id);
}
this.handleAPI = function(api) {
this.api = api;
}
}
- Documentation
- › API
- › Global objects API
- › EmbeddedXopus.removeListener
EmbeddedXopus.removeListener( listener : Function | Object[, windowName : String])
: Function | Object[, windowName : String])Arguments
- listener
- Function | Object. The handler
- windowName
- String. The name of the window on which to execute the handler. (Optional)