public interface DomListenerRegistration extends Registration
Element.addEventListener(String, DomEventListener)| Modifier and Type | Method and Description |
|---|---|
DomListenerRegistration |
addEventData(String eventData)
Add a JavaScript expression for extracting event data.
|
default DomListenerRegistration |
debounce(int timeout)
Configures this listener to be notified only when at least
timeout milliseconds has passed since the last time the
event was triggered. |
DomListenerRegistration |
debounce(int timeout,
DebouncePhase firstPhase,
DebouncePhase... rest)
Configures the debouncing phases for which this listener should be
triggered.
|
String |
getFilter()
Gets the currently set filter expression.
|
DomListenerRegistration |
setDisabledUpdateMode(DisabledUpdateMode disabledUpdateMode)
Configure whether this listener will be called even in cases when the
element is disabled.
|
DomListenerRegistration |
setFilter(String filter)
Sets a JavaScript expression that is used for filtering events to this
listener.
|
default DomListenerRegistration |
throttle(int period)
Configures this listener to not be notified more often than
period milliseconds. |
removeDomListenerRegistration addEventData(String eventData)
element refers to this element and event refers
to the fired event. If multiple expressions are defined for the same
event, their order of execution is undefined.
The result of the evaluation is available in
DomEvent.getEventData() with the expression as the key in the
JSON object. An expression might be e.g.
element.value the get the value of an input element for
a change event.
event.button === 0 to get true for click events
triggered by the primary mouse button.
eventData - definition for data that should be passed back to the server
together with the event, not nullDomListenerRegistration setFilter(String filter)
true-ish according to JavaScript type coercion rules. The
expression is evaluated in a context where element refers to
this element and event refers to the fired event.
An expression might be e.g. event.button === 0 to only
forward events triggered by the primary mouse button.
Any previous filter for this registration is discarded.
filter - the JavaScript filter expression, or null to
clear the filterString getFilter()
null if no filter
is in usesetFilter(String)DomListenerRegistration setDisabledUpdateMode(DisabledUpdateMode disabledUpdateMode)
disabledUpdateMode - controls RPC communication from the client side to the server
side when the element is disabled, not nullDomListenerRegistration debounce(int timeout, DebouncePhase firstPhase, DebouncePhase... rest)
timeout is set to 0.
This methods overrides the settings previously set through
debounce(int), throttle(int) or
debounce(int, DebouncePhase, DebouncePhase...).
timeout - the debounce timeout in milliseconds, or 0 to disable
debouncingfirstPhase - the first phase to userest - any remaining phases to useDebouncePhasedefault DomListenerRegistration debounce(int timeout)
timeout milliseconds has passed since the last time the
event was triggered. This is useful for cases such as text input where
it's only relevant to know the result once the user stops typing.
Debouncing is disabled if the timeout is set to 0.
This methods overrides the settings previously set through
debounce(int), throttle(int) or
debounce(int, DebouncePhase, DebouncePhase...).
timeout - the debounce timeout in milliseconds, or 0 to disable
debouncingdefault DomListenerRegistration throttle(int period)
period milliseconds.
Throttling is disabled if the period is set to 0.
This methods overrides the settings previously set through
debounce(int), throttle(int) or
debounce(int, DebouncePhase, DebouncePhase...).
period - the minimum period between listener invocations, or 0 to
disable throttlingCopyright © 2000–2019 Vaadin Ltd. All rights reserved.