Interface: LifecycleListener

Oracle® JavaScript Extension Toolkit (JET)
1.2.0

E65435-01

QuickNav

ojModule. LifecycleListener

Version:
  • 1.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:
  • 'element' - DOM element where the binding is attached. This may be a 'virtual' element (comment node)
  • 'valueAccessor' - 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:
  • 'element' - DOM element where the binding is attached. This may be a 'virtual' element (comment node)
  • 'valueAccessor' - binding's value accessor
  • 'viewModel' - ViewModel for the View being attached
  • 'fromCache' - a boolean indicating the view was retrieved from cache
Source:

bindingsApplied(info)

Invoked after the bidnings are applied on this View. 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:
  • 'element' - DOM element where the binding is attached. This may be a 'virtual' element (comment node)
  • 'valueAccessor' - binding's value accessor
  • 'viewModel' - ViewModel for the View being attached
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:
  • 'element' - DOM element where the binding is attached. This may be a 'virtual' element (comment node)
  • 'valueAccessor' - binding's value accessor
  • 'viewModel' - ViewModel being deactivated
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:
  • 'element' - DOM element where the binding is attached. This may be a 'virtual' element (comment node)
  • 'valueAccessor' - binding's value accessor
  • 'viewModel' - ViewModel for the View being detached
  • 'cachedNodes' - an Array containing cached nodes for the View (if the cache is enabled)
Source: