pp108 : removeListener()

removeListener()


It unregisters the control from the event handler, so that the function stops getting called when the event fires on the control.

Syntax

Script

<control ID>.removeListener(sEventName, fpFunction)


Parameters

Parameter

Description

sEventName

Required. String that denotes any of the standard XForm events.

fpFunction

Required. Pointer that specifies the function to be invoked when the event is triggered.


Remarks


For methods attached to an event using the addListener() method, use the removeListener() method to detach them, and prevent the execution of the function when the event is fired.

The following events are supported by the removeListener() method.

Model Events
xforms-onbeforeinsert, xforms-insert, xforms-onafterinsert, xforms-onbeforedelete, xforms-delete, xforms-onafterdelete, xforms-onbeforechange, xforms-change, xforms-onafterchange, xforms-onbeforesynchronize, xforms-onsynchronized, xforms-onrequest, xforms-onresponse, xforms_onfind, xforms-onsoapfault, xforms-ondatacompleted.

HTML Control Events
xforms-onbeforezoom, xforms-onafterzoom, xforms-onexpand, xforms-oncollapse, xforms-before-data-bind, xforms-onvalidate, xforms-value-changed, DOMFocusIn, DOMFocusOut, xforms-select-before-data-fill, xforms_onrowselect, xforms_onrowchecked, onbeforesynchronizeddialogopen, xforms-activate, onbeforeinsert, onbeforedelete, onbeforerefresh, onbeforefirst, onbeforenext, onbeforeprevious, onbeforelast, onbeforefind, onbeforeshowall, onbeforesave, onafterinsert, onafterdelete, onafterrefresh, onafterfirst, onafternext, onafterprevious, onafterlast, onafterfind, onaftershowall, onaftersave.

Example


This example demonstrates the use of the removeListener() method to detach thecallOnBeforeZoomfunction from the Before Zoom event of a control.

// input1 is the ID of the control to which zoom is attached
input1.removeListener("xforms-onbeforezoom", callOnBeforeZoom);

Applies to


All Controls, Model, WebForm

Related reference

addListener()