Class: Components

Oracle® Fusion Middleware Oracle JavaScript Extension Toolkit (JET)
12c (12.1.4)

E54107-01

QuickNav

oj. Components

JET Component services

Constructor

new Components()

Source:

Methods

<static> createDynamicPropertyGetter(callback) → {Object}

Creates a dynamic getter that can be used as a property value in oj.Components.setDefaultOptions()
Parameters:
Name Type Description
callback Function dynamic property callback. The callback will receive a context object as a parameter. The following properties are currently supported on the context object:
  • containers - an array of component names of the current component's containers that require special behavior from their children
The callback should return the computed property value
Source:
See:
Returns:
- dynamic property getter
Type
Object

<static> getDefaultOptions() → {Object}

Retrieves default option values for JET components.
Source:
See:
Returns:
default option values
Type
Object

<static> getWidgetConstructor(element, widgetName) → {Function|null}

Retrieves widget constructor associated with the HTML element or null if none is found. The returned constructor is already bound to the associated JQuery element, so it can be invoked as a function directly. For example:
widgetConstructor("option", "label", "custom"); // sets label option
If widgetName is not specified, and if more than one widget is associated with the element, the method will a return the widget that was created first.
Parameters:
Name Type Argument Description
element Element HTML element
widgetName string <optional>
optional widget name
Source:
Returns:
widget constructor
Type
Function | null

<static> setDefaultOptions(options)

Sets default options values for JET components.
Parameters:
Name Type Description
options Object property values that will be merged into the values that were previously set using this method. The options object is expected to have the format demonstrated by the following example:
{
  'default': // properties for all JET components 
  {
    'option1': 'somevalue'
  },
  'editableValue': // properties for editableValue components 
  {
    'option1': 'somevalue1',
    'option2': oj.Components.createDynamicPropertyGetter(function(context){
                                return context['containers'].indexOf('ojTable') >= 0 ? 'tableValue' : 'normalValue'})
  },
  'ojText': // properties for instances of ojText 
  {
    'option1': 'somevalue2'
  }
}
To specify a dynamic getter for the property, pass your callback to oj.Components.createDynamicPropertyGetter(). Note that dynamic getters nested within a complex property value are not supported
Source:
See: