Interface: LifecycleListener

Oracle® JavaScript Extension Toolkit (JET)
3.2.0

E87541-01

QuickNav

ojModule. LifecycleListener

Version:
  • 3.2.0
A duck-typing interface that defines methods for the ojModule binding's lifecycle listener. Use 'lifecycleListener' option on the ojModule binding to set the listener.
Source:

Methods

activated(info) → {Promise|undefined}

Invoked when the binding starts loading a new View and ViewModel
Parameters:
Name Type Description
info Object an object with the following key-value pairs:
Properties
Name Type Description
element Node DOM element or where the binding is attached. This may be a 'virtual' element (comment node)
valueAccessor Function binding's value accessor
Source:
Returns:
- If the callback returns a Promise, the next phase (attaching DOM) will be delayed until the promise is resolved
Type
Promise | undefined

attached(info)

Invoked after the View is inserted into the document DOM
Parameters:
Name Type Description
info Object an object with the following key-value pairs:
Properties
Name Type Description
element Node DOM element or where the binding is attached. This may be a 'virtual' element (comment node)
valueAccessor Function binding's value accessor
viewModel Object ViewModel for the View being attached
fromCache boolean a boolean indicating the view was retrieved from cache
Source:

bindingsApplied(info)

Invoked after the bidnings for the new View are applied. If the current View is retrieved from cache, the bindings will not be re-applied, and this callback will not be invoked.
Parameters:
Name Type Description
info Object an object with the following key-value pairs:
Properties
Name Type Description
element Node DOM element or where the binding is attached. This may be a 'virtual' element (comment node)
valueAccessor Function binding's value accessor
viewMode Object ViewModel for the new View
Source:

deactivated(info)

Invoked when the View/ViewModel combination becomes inactive
Parameters:
Name Type Description
info Object an object with the following key-value pairs:
Properties
Name Type Description
element Node DOM element or where the binding is attached. This may be a 'virtual' element (comment node)
valueAccessor Function binding's value accessor
viewModel Object ViewModel for the View being attached
Source:

detached(info)

Invoked after the View is removed from the document DOM
Parameters:
Name Type Description
info Object an object with the following key-value pairs:
Properties
Name Type Description
element Node DOM element or where the binding is attached. This may be a 'virtual' element (comment node)
valueAccessor Function binding's value accessor
viewModel Object ViewModel for the View being attached
cachedNodes Array an Array containing cached nodes for the View (if the cache is enabled)
Source:

transitionCompleted(info)

Invoked after transition to the new View is complete. That includes any possible animation between the old and the new View
Parameters:
Name Type Description
info Object an object with the following key-value pairs:
Properties
Name Type Description
element Node DOM element or where the binding is attached. This may be a 'virtual' element (comment node)
valueAccessor Function binding's value accessor
viewMode Object ViewModel for the new View
Source: