Class ElementJsInitializerRegistration
- All Implemented Interfaces:
Registration,Serializable
Element.addJsInitializer(String, Object...) or
Element.addJsInitializer(JsFunction).
Re-emits the init invocation each time the client acquires a fresh DOM for
this element, and emits a matching dispose when the registration is removed.
The initializer is sent as a JsFunction parameter of the declared
ElementJsInitializerRegistration.InitializerJs calls, which delegate the registry bookkeeping to the
registerInitializer / disposeInitializer callbacks of the
client-side execution context. An initializer declared as a snippet is
therefore not compiled from a string in the browser.
For internal use only.
- Since:
- 25.2
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceRuns and disposes of an initializer on the client, as a JavaScript definition. -
Constructor Summary
ConstructorsConstructorDescriptionElementJsInitializerRegistration(StateNode node, JsFunction initializer) Creates a new registration for the given initializer and schedules the first init invocation if the node is currently attached.ElementJsInitializerRegistration(StateNode node, String expression, Object[] parameters) Creates a new registration for an expression given by the application and schedules the first init invocation if the node is currently attached. -
Method Summary
Modifier and TypeMethodDescriptionvoidremove()Removes the associated listener from the event source.
-
Constructor Details
-
ElementJsInitializerRegistration
Creates a new registration for an expression given by the application and schedules the first init invocation if the node is currently attached. The expression is compiled from a string in the browser.- Parameters:
node- the owning state node, notnullexpression- the user-supplied expression, notnullparameters- the user-supplied parameters, captured by the JsFunction
-
ElementJsInitializerRegistration
Creates a new registration for the given initializer and schedules the first init invocation if the node is currently attached.The initializer is applied with the element as
thisand no arguments, and returns a cleanup function,nullorundefined, as described forElement.addJsInitializer(String, Object...). One declared as asnippetis not compiled from a string in the browser.- Parameters:
node- the owning state node, notnullinitializer- the initializer to run, notnull
-
-
Method Details
-
remove
public void remove()Description copied from interface:RegistrationRemoves the associated listener from the event source.The
removemethod called after removal does nothing.- Specified by:
removein interfaceRegistration- See Also:
-