Class: ValueBinding

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

E54107-01

QuickNav

oj. ValueBinding

Constructor

new ValueBinding()

An extension to oj.ComponentBinding, properties exposed on this binding are available to jet components that extend from oj.editableValue.
Source:
See:

Fields

#invalidComponentTracker

An array of objects containing the following properties
  • 'component' - the component instance
  • 'valid' - whether the component is valid or not.
When this attribute is present, the binding registers a default handler for the 'optionChange' event fired by jet value holder components whenever its validity (i.e. 'messages' option) changes. The handler pushes the current validity of the component into the tracker. The same array instance can be used across multiple component binding declarations. E.g.,
Source:
Example

Track validity of multiple components using the same array for the invalidComponentTracker attribute:

<input id="username" type="text" name="username" required 
  data-bind="ojComponent: {component: 'ojInputText', value: userName, 
                           invalidComponentTracker: invalidComponents}">
<input id="password" type="password" name="password" required 
  data-bind="ojComponent: {component: 'ojInputPassword', value: password, 
  invalidComponentTracker: invalidComponents}"/>
  
// The viewModel that defines the invalidComponents array 
<script>
function MemberViewModel() 
{ 
  var self = this;
  
  self.invalidComponents = ko.observableArray([]);
  self.userName = ko.observable();   
  self.password = ko.observable();
}
</script>