Note: Application logic should not interact with the component's properties or invoke its methods until the BusyContext indicates that the component is ready for interaction.
Slots
JET elements can have up to two types of child content:
- Any child element with a
slotattribute will be moved into that named slot, e.g.<span slot='startIcon'>...</span>. All supported named slots are documented below. Child elements with unsupported named slots will be removed from the DOM. - Any child element lacking a
slotattribute will be moved to the default slot, also known as a regular child.
-
contextMenu
-
The contextMenu slot is set on the
oj-menuwithin this element. This is used to designate the JET Menu that this component should launch as a context menu on right-click, Shift-F10, Press & Hold, or component-specific gesture. If specified, the browser's native context menu will be replaced by the JET Menu specified in this slot.The application can register a listener for the Menu's ojBeforeOpen event. The listener can cancel the launch via event.preventDefault(), or it can customize the menu contents by editing the menu DOM directly, and then calling refresh() on the Menu.
To help determine whether it's appropriate to cancel the launch or customize the menu, the ojBeforeOpen listener can use component API's to determine which table cell, chart item, etc., is the target of the context menu. See the JSDoc and demos of the individual components for details.
Keep in mind that any such logic must work whether the context menu was launched via right-click, Shift-F10, Press & Hold, or component-specific touch gesture.
Example
Initialize the component with a context menu:
<oj-some-element> <-- use the contextMenu slot to designate this as the context menu for this component --> <oj-menu slot="contextMenu" style="display:none" aria-label="Some element's context menu"> ... </oj-menu> </oj-some-element>
Attributes
-
async-validators :Array.<oj.AsyncValidator.<V>>
-
List of asynchronous validators used by the component when performing validation.
Use
async-validatorswhen you need to perform some validation work on the server. Otherwise, usevalidators, which are synchronous.Each item in the Array is an instance that duck types oj.AsyncValidator. Implicit validators created by a component when certain attributes are present (e.g.
requiredattribute) are separate from validators specified through theasync-validatorsattribute and thevalidatorsattribute. At runtime when the component runs validation, it combines the implicit validators with the list specified through thevalidatorsattribute and also the list specified through theasync-validatorsattribute. Error messages are shown as soon as each async validator returns; we do not wait until all the async validators finish to show errors. If the component's valid state changes for the worse, it is also updated as each validator returns so valid will be invalidShown as soon as the first validator has an Error.It is recommended that you show the value you are validating in the error message because if the async operation takes a while, the user could be typing in a new value when the error message comes back and might be confused what value the error is for. However, if the user enters a new value (like presses Enter or Tab), a new validation lifecycle will start and validation errors for the previous value will not be shown to the user. If you need to format the value for the error message, you can use
oj.IntlConverterUtils.getConverterInstance(converterOption)to get the converter instance, then callconverter.format(value).Hints exposed by async-validators and validators are shown in the notewindow by default, or as determined by the 'validatorHint' property set on the
display-optionsattribute.Since async validators are run asynchronously, you should wait on the BusyContext before you check valid property or the value property. Alternatively you can add a callback to the onValidChanged or ojValueChanged events.
The steps performed always, running validation and clearing messages is the same as for the
oj.inputBase#validatorsattribute.
- Default Value:
[]
Names
Item Name Property asyncValidatorsProperty change event asyncValidatorsChangedProperty change listener attribute (must be of type function) on-async-validators-changedExamples
Create an Object that duck-types the oj.AsyncValidator interface. Bind the Object to the JET form component's async-validators attribute. The validator's 'validate' method will be called when the user changes the input.
self.asyncValidator1 = { // required validate method 'validate': function(value) { return new Promise(function(resolve, reject) { var successful = someBackendMethod(); if (successful) { resolve(true); } else { reject(new Error('The amount of purchase is too high. It is ' + value)); } }); }, // optional hint attribute. hint shows up when user sets focus to input. 'hint': new Promise(function (resolve, reject) { var formattedMaxPurchase = getSomeBackendFormattedMaxPurchase(); resolve(maxPurchase + " is the maximum."); }); }; -- HTML -- <oj-input-text value="{{value}}" async-validators="[[[asyncValidator1]]]"></oj-input-text>Initialize the component with multiple AsyncValidator duck-typed instances:
-- HTML -- <oj-input-text id="asyncValKo1" data-oj-context valid="{{koAsyncValid}}" value="{{koAsyncValue}}" required validators="[[[checkfoo, checkfooey]]]" async-validators="[[[asyncValidator1, asyncValidator2]]]"></oj-input-text>Get or set the
asyncValidatorsproperty after initialization:// getter var validators = myComp.asyncValidators; // setter var myValidators = [{ 'validate' : function(value) { return new Promise(function(resolve, reject) { // mock server-side delay setTimeout(function () { if (value === "pass" || value === "another pass") { resolve(true); } else { reject(new Error("value isn't 'pass' or 'another pass'. It is " + value.)); } },10); }); } }]; myComp.asyncValidators = myValidators; -
autocomplete :('on'|'off'|string)
-
Dictates component's autocomplete state. This attribute indicates whether the value of the control can be automatically completed by the browser. The common values are "on" and "off".
Since this attribute passes through to the input element unchanged, you can look at the html specs for detailed information for how browsers behave and what values besides "on" and "off" you can set. The html spec says the default is "on", so when autocomplete is not explicitly set, the browsers treat it as "on".
- Default Value:
"on"
- Since:
- 4.0.0
- See:
Names
Item Name Property autocompleteProperty change event autocompleteChangedProperty change listener attribute (must be of type function) on-autocomplete-changedExamples
Initialize component with
autocompleteattribute:<oj-some-element autocomplete="on"></oj-some-element>Get or set the
autocompleteproperty after initialization:// getter var ro = myComp.autocomplete; // setter myComp.autocomplete = "on"; -
autofocus :boolean
-
Autofocus is a Boolean that reflects the autofocus attribute, If it is set to true then the associated component will get input focus when the page is loaded. Setting this property doesn't set the focus to the component: it tells the browser to focus to it when the element is inserted in the document.
- Default Value:
false
- Since:
- 4.0.0
Names
Item Name Property autofocusProperty change event autofocusChangedProperty change listener attribute (must be of type function) on-autofocus-changedExamples
Initialize component with
autofocusattribute:<oj-some-element autofocus></oj-some-element>Get or set the
autofocusproperty after initialization:// getter var ro = myComp.autofocus; // setter myComp.autofocus = false; -
converter :(oj.Converter.<string>|oj.Validation.RegisteredConverter)
-
Default converter for InputTime If one wishes to provide a custom converter for the InputTime override the factory returned for oj.Validation.converterFactory(oj.ConverterFactory.CONVERTER_TYPE_DATETIME)
When
converterproperty changes due to programmatic intervention, the element performs various tasks based on the current state it is in.
Steps Performed Always
- Any cached converter instance is cleared and new converter created. The converter hint is pushed to messaging. E.g., notewindow displays the new hint(s).
Running Validation
- if element is valid when
converterproperty changes, the display value is refreshed. - if element is invalid and is showing messages when
converterproperty changes then all element messages are cleared and full validation run using the current display value on the element.- if there are validation errors, then
valueproperty is not updated, and the error is shown. The display value is not refreshed in this case. - if no errors result from the validation, the
valueproperty is updated; page author can listen to theonValueChangedevent to clear custom errors. The display value is refreshed with the formatted value provided by converter.
- if there are validation errors, then
- if element is invalid and has deferred messages when converter property changes, the display value is again refreshed with the formatted value provided by converter.
Clearing Messages
- Only messages created by the element are cleared.
messagesCustomproperty is not cleared. Page authors can choose to clear it explicitly when setting the converter option.
- Default Value:
oj.Validation.converterFactory(oj.ConverterFactory.CONVERTER_TYPE_DATETIME).createConverter({"hour": "2-digit", "minute": "2-digit"})
Names
Item Name Property converterProperty change event converterChangedProperty change listener attribute (must be of type function) on-converter-changed -
(nullable) described-by :string
-
It is used to establish a relationship between this component and another element. Typically this is not used by the application developer, but by the oj-label custom element's code. One use case is where the oj-label custom element code writes described-by on its form component for accessibility reasons. To facilitate correct screen reader behavior, the described-by attribute is copied to the aria-describedby attribute on the component's dom element.
- Since:
- 4.0.0
Names
Item Name Property describedByProperty change event describedByChangedProperty change listener attribute (must be of type function) on-described-by-changedExamples
Initialize component with the
described-byattribute specified:<oj-some-element described-by="someId"></oj-some-element>Get or set the
describedByproperty after initialization:// getter var descById = myComp.describedBy; // setter myComp.describedBy = "someId"; -
disabled :boolean
-
Whether the component is disabled. The default is false.
When the
disabledproperty changes due to programmatic intervention, the component may clear messages and run validation in some cases.
- when a required component is initialized as disabled
value="{{currentValue}}" required disabled, deferred validation is skipped. - when a disabled component is enabled,
- if component is invalid and showing messages then all component messages are cleared,
and full validation run using the display value.
- if there are validation errors, they are shown.
- if no errors result from the validation, the
valueproperty is updated. Page authors can listen to theonValueChangedevent to clear custom errors.
- if component is valid and has no errors then deferred validation is run.
- if there is a deferred validation error, then the valid property is updated.
- if component is invalid and deferred errors then component messages are cleared and
deferred validation re-run.
- if there is a deferred validation error, then the valid property is updated.
- if component is invalid and showing messages then all component messages are cleared,
and full validation run using the display value.
- when enabled component is disabled then no validation is run and the component appears disabled.
- Default Value:
false
- Since:
- 0.7
Names
Item Name Property disabledProperty change event disabledChangedProperty change listener attribute (must be of type function) on-disabled-changedExamples
Initialize component with
disabledattribute:<oj-some-element disabled></oj-some-element>Get or set the
disabledproperty after initialization:// getter var disabled = myComp.disabled; // setter myComp.disabled = false; - when a required component is initialized as disabled
-
display-options :Object
-
Display options for auxilliary content that determines where it should be displayed in relation to the component.
The types of messaging content for which display options can be configured include
converterHint,helpInstruction,messages, andvalidatorHint.
The display options for each type is specified either as an array of strings or a string. When an array is specified the first display option takes precedence over the second and so on.When display-options changes due to programmatic intervention, the component updates its display to reflect the updated choices. For example, if 'help.instruction' property goes from 'notewindow' to 'none' then it no longer shows in the notewindow.
A side note: help.instruction and message detail text can include formatted HTML text, whereas hints and message summary text cannot. If you use formatted text, it should be accessible and make sense to the user if formatting wasn't there. To format the help.instruction, you could do this:
<html>Enter <b>at least</b> 6 characters</html>- Since:
- 0.7
Names
Item Name Property displayOptionsProperty change event displayOptionsChangedProperty change listener attribute (must be of type function) on-display-options-changedExamples
Override default values for
display-optionsfor one component:// In this example, the display-options are changed from the defaults. // The 'converterHint' is none, the 'validatorHint' is none and the 'helpInstruction' is none, // so only the 'messages' will display in its default state. // <oj-some-element display-options='{"converterHint": "none", "validatorHint": "none", "helpInstruction": "none"}'></oj-some-element>Get or set the
displayOptionsproperty after initialization:// Get one subproperty var hint = myComp.displayOptions.converterHint; // Set one, leaving the others intact. Use the setProperty API for // subproperties so that a property change event is fired. myComp.setProperty("displayOptions.converterHint", "none"); // get all var options = myComp.displayOptions; // set all. Must list every resource key, as those not listed are lost. myComp.displayOptions = {converterHint: "none", validatorHint: "none", helpInstruction: "none"}; -
display-options.converter-hint :(Array.<('placeholder'|'notewindow'|'none')>|'placeholder'|'notewindow'|'none')
-
Display options for auxilliary converter hint text that determines where it should be displayed in relation to the component. When there is already a placeholder set on the component, the converter hint falls back to display type of 'notewindow'.
- Default Value:
['placeholder','notewindow']
- Since:
- 0.7
Names
Item Name Property displayOptions.converterHint -
display-options.help-instruction :(Array.<('notewindow'|'none')>|'notewindow'|'none')
-
Display options for auxilliary help instruction text that determines where it should be displayed in relation to the component.
- Default Value:
['notewindow']
- Since:
- 0.7
Names
Item Name Property displayOptions.helpInstruction -
display-options.messages :(Array.<('inline'|'notewindow'|'none')>|'inline'|'notewindow'|'none')
-
Display options for auxilliary message text that determines where it should be displayed in relation to the component.
- Default Value:
['inline']
- Since:
- 0.7
Names
Item Name Property displayOptions.messages -
display-options.validator-hint :(Array.<('notewindow'|'none')>|'notewindow'|'none')
-
Display options for auxilliary validator hint text that determines where it should be displayed in relation to the component.
- Default Value:
['notewindow']
- Since:
- 0.7
Names
Item Name Property displayOptions.validatorHint -
help :Object
-
Form component help information.
The properties supported on the
helpoption are:- Since:
- 0.7
Properties:
Name Type Argument Description instructionstring <optional>
this represents advisory information for the component The default value is null.Names
Item Name Property helpProperty change event helpChangedProperty change listener attribute (must be of type function) on-help-changed -
help.instruction :string
-
Represents advisory information for the component, such as would be appropriate for a tooltip.
When help.instruction is present it is by default displayed in the notewindow, or as determined by the 'helpInstruction' property set on the
displayOptionsattribute. When thehelp.instructionproperty changes the component refreshes to display the updated information.JET takes the help instruction text and creates a notewindow with the text. The help instruction only shows up as a tooltip on mouse over, not on keyboard and not in a mobile device. So help instruction would only be for text that is not important enough to show all users, or for text that you show the users in another way as well, like in the label. Also you cannot theme the native browser's title window like you can the JET notewindow, so low vision users may have a hard time seeing it. For these reasons, the JET EditableValue components do not use the HTML's title attribute.
To include formatted text in the help.instruction, format the string using html tags. For example the help.instruction might look like:
If you use formatted text, it should be accessible and make sense to the user if formatting wasn't there.<oj-some-element help.instruction="<html>Enter <b>at least</b> 6 characters</html>"></oj-some-element>- Default Value:
""
- Since:
- 4.0.0
Names
Item Name Property help.instructionExamples
Initialize the component with the
help.instructionsub-attribute:<oj-some-element help.instruction="some tooltip"></oj-some-element>Get or set the
help.instructionproperty after initialization:// Get one subproperty var instr = myComp.help.instruction; // Set one subproperty, leaving the others intact. Use the setProperty API for // subproperties so that a property change event is fired. myComponent.setProperty('help.instruction', 'some new value'); // Get all var values = myComponent.help; // Set all. Must list every resource key, as those not listed are lost. myComponent.help = { instruction: 'some new value' }; -
help-hints :Object
-
Represents hints for oj-form-layout element to render help information on the label of the editable component.
This is used only if the editable component is added as a direct child to an oj-form-layout element, and the labelHint property is also specified.
The helpHints object contains a definition property and a source property.
definition- hint for help definition text.source- hint for help source URL.
- Since:
- 4.1.0
Names
Item Name Property helpHintsProperty change event helpHintsChangedProperty change listener attribute (must be of type function) on-help-hints-changedExamples
Initialize the component with help hints:
<!-- Using dot notation --> <oj-some-element help-hints.definition='some value' help-hints.source='some-url'></oj-some-element> <!-- Using JSON notation --> <oj-some-element help-hints='{"definition":"some value", "source":"some-url"}'></oj-some-element>Get or set the
helpHintsproperty after initialization:// Get one var value = myComponent.helpHints.definition; // Set one, leaving the others intact. Always use the setProperty API for // subproperties rather than setting a subproperty directly. myComponent.setProperty('helpHints.definition', 'some new value'); // Get all var values = myComponent.helpHints; // Set all. Must list every subproperty, as those not listed are lost. myComponent.helpHints = { definition: 'some new value', source: 'some-new-url' }; -
help-hints.definition :string
-
Hint for help definition text associated with the label.
It is what shows up when the user hovers over the help icon, or tabs into the help icon, or press and holds the help icon on a mobile device. No formatted text is available for help definition attribute.
See the help-hints attribute for usage examples.
- Default Value:
""
- Since:
- 4.1.0
Names
Item Name Property helpHints.definition -
help-hints.source :string
-
Hint for help source URL associated with the label.
If present, a help icon will render next to the label. For security reasons we only support urls with protocol http: or https:. If the url doesn't comply we ignore it and throw an error. Pass in an encoded URL since we do not encode the URL.
See the help-hints attribute for usage examples.
- Default Value:
""
- Since:
- 4.1.0
Names
Item Name Property helpHints.source -
keyboard-edit :string
-
Determines if keyboard entry of the text is allowed. When disabled the picker must be used to select a time. Default value depends on the theme. In alta-android, alta-ios and alta-windows themes, the default is
"disabled"and it's"enabled"for alta web theme.Supported Values:
Name Type Description "disabled"string Changing the time can only be done with the picker. "enabled"string Allow keyboard entry of the time. Names
Item Name Property keyboardEditProperty change event keyboardEditChangedProperty change listener attribute (must be of type function) on-keyboard-edit-changedExamples
Initialize the InputTime with the
keyboard-editattribute specified:<oj-input-time keyboard-edit='disabled'></oj-input-time>Get or set the
keyboardEditproperty after initialization:// getter var keyboardEdit = myInputTime.keyboardEdit; // setter myInputTime.keyboardEdit = 'disabled';Set the default in the theme (SCSS)
$inputDateTimeKeyboardEditOptionDefault: disabled !default; -
label-hint :string
-
Represents a hint for oj-form-layout element to render a label on the editable component.
This is used only if the editable component is added as a direct child to an oj-form-layout element.
When labelHint is present it gives a hint to the oj-form-layout element to create an oj-label element for the editable component. When the
labelHintproperty changes oj-form-layout element refreshes to display the updated label information.- Default Value:
""
- Since:
- 4.1.0
Names
Item Name Property labelHintProperty change event labelHintChangedProperty change listener attribute (must be of type function) on-label-hint-changedExamples
Initialize the component with the
label-hintattribute specified:<oj-some-element label-hint='input label'></oj-some-element>Get or set the
labelHintproperty after initialization:// getter var value = myComponent.labelHint; // setter myComponent.labelHint = 'some new value' -
max :string|null
-
The maximum selectable time. When set to null, there is no maximum.
- type string - ISOString
- null - no limit
- Default Value:
null
Names
Item Name Property maxProperty change event maxChangedProperty change listener attribute (must be of type function) on-max-changedExamples
Initialize the InputTime with the
maxattribute specified:<oj-input-time max='T13:30:00.000-08:00'></oj-input-time>Get or set the
maxproperty after initialization:// getter var maxValue = myInputTime.max; // setter myInputTime.max = 'T13:30:00.000-08:00'; -
messages-custom :Array.<Object>
-
List of messages an app would add to the component when it has business/custom validation errors that it wants the component to show. This allows the app to perform further validation before sending data to the server. When this option is set the message shows to the user right away. To clear the custom message, set
messagesCustomback to an empty array.
Each message in the array is an object that duck types oj.Message. See oj.Message for details.
See the Validation and Messages section for details on when the component clears
messagesCustom; for example, when full validation is run.- Default Value:
[]
- Supports writeback:
true
- Since:
- 0.7
Names
Item Name Property messagesCustomProperty change event messagesCustomChangedProperty change listener attribute (must be of type function) on-messages-custom-changedExamples
Get or set the
messagesCustomproperty after initialization:// getter var customMsgs = myComp.messagesCustom; // setter myComp.messagesCustom = [{summary:"hello", detail:"detail", severity:oj.Message.SEVERITY_LEVEL.INFO}];Set messagesCustom when there are cross-validation errors:
--- HTML --- <oj-some-element messages-custom='{{messagesCustom}}'></oj-some-element> --- ViewModel code --- self.messagesCustom = ko.observableArray([]); // the app's function that gets called when the user presses the submit button if (!myValidateCrossValidationFields()) { // the app adds a custom messages to the component and it is displayed right away var msgs = []; msgs.push({'summary':'Cross field error', 'detail':'Field 1 needs to be less than Field 2'}); self.messagesCustom(msgs); } else { // submit data to the server } -
min :string|null
-
The minimum selectable time. When set to null, there is no minimum.
- type string - ISOString
- null - no limit
- Default Value:
null
Names
Item Name Property minProperty change event minChangedProperty change listener attribute (must be of type function) on-min-changedExamples
Initialize the InputTime with the
minattribute specified:<oj-input-time min='T08:00:00.000-08:00'></oj-input-time>Get or set the
minproperty after initialization:// getter var minValue = myInputTime.min; // setter myInputTime.min = 'T08:00:00.000-08:00'; -
name :string
-
It indicates the name of the component.
- Default Value:
""
- Since:
- 4.0.0
Names
Item Name Property nameProperty change event nameChangedProperty change listener attribute (must be of type function) on-name-changedExamples
Initialize component with
nameattribute:<oj-some-element name="myName"></oj-some-element>Get or set the
nameproperty after initialization:// getter var ro = myComp.name; // setter myComp.name = myName; -
(nullable) picker-attributes :Object
-
Attributes specified here will be set on the picker DOM element when it's launched.
The supported attributes are
classandstyle, which are appended to the picker's class and style, if any. Note: 1) pickerAttributes is not applied in the native theme. 2) setting this property after element creation has no effect.- Default Value:
null
Properties:
Name Type Argument stylestring <optional>
classstring <optional>
Names
Item Name Property pickerAttributesProperty change event pickerAttributesChangedProperty change listener attribute (must be of type function) on-picker-attributes-changedExamples
Initialize the inputTime specifying a set of attributes to be set on the picker DOM element:
myInputTime.pickerAttributes = { "style": "color:blue;", "class": "my-class" };Get the
pickerAttributesproperty, after initialization:// getter var pickerAttrs = myInputTime.pickerAttributes; -
placeholder :string
-
The placeholder text to set on the element.
Names
Item Name Property placeholderProperty change event placeholderChangedProperty change listener attribute (must be of type function) on-placeholder-changedExamples
Initialize the component with the
placeholderattribute:<oj-some-element placeholder="User Name"></oj-some-element>Get or set the
placeholderproperty after initialization:// getter var myPh = myComp.placeholder; // setter myComp.placeholder = myPlaceholder; If the attribute is not set and if a converter is set then the converter hint is used. See displayOptions for details. -
(readonly) raw-value :string
-
The
rawValueis the read-only property for retrieving the current value from the input field in string form. The main consumer ofrawValueis a converter.The
rawValueupdates on the 'input' javascript event, so therawValuechanges as the value of the input is changed. If the user types in '1,200' into the field, the rawValue will be '1', then '1,', then '1,2', ..., and finally '1,200'. Then when the user blurs or presses Enter thevalueproperty gets converted and validated (if there is a converter or validators) and then gets updated if valid.This is a read-only attribute so page authors cannot set or change it directly.
- Supports writeback:
true
- Since:
- 1.2.0
Names
Item Name Property rawValueProperty change event rawValueChangedProperty change listener attribute (must be of type function) on-raw-value-changed -
readonly :boolean
-
Dictates component's readonly state.
- Default Value:
false
Names
Item Name Property readonlyProperty change event readonlyChangedProperty change listener attribute (must be of type function) on-readonly-changedExamples
Initialize component with
readonlyattribute:<oj-some-element readonly></oj-some-element>Get or set the
readonlyproperty after initialization:// getter var ro = myComp.readonly; // setter myComp.readonly = false; -
render-mode :string
-
Allows applications to specify whether to render time picker in JET or as a native picker control.
Default value depends on the theme. In alta-android, alta-ios and alta-windows themes, the default is "native" and it's "jet" for alta web theme.- Time picker cannot be themed
- Accessibility is limited to what the native picker supports
- pickerAttributes is not applied
- Sub-IDs are not available
- hide() function is no-op
- translations sub properties pertaining to the picker is not available
- 'timePicker.timeIncrement' property is limited to iOS and will only take a precision of minutes
Supported Values:
Name Type Description 'jet'string Applications get full JET functionality. 'native'string Applications get the functionality of the native picker.
Note that the native picker support is limited to Cordova plugin published at 'https://github.com/VitaliiBlagodir/cordova-plugin-datepicker'.
With native renderMode, the functionality that is sacrificed compared to jet renderMode are:Names
Item Name Property renderModeProperty change event renderModeChangedProperty change listener attribute (must be of type function) on-render-mode-changedExamples
Initialize the InputTime with the
render-modeattribute specified:<oj-input-time render-mode='native'></oj-input-time>Get or set the
renderModeproperty after initialization:// getter var renderMode = myInputTime.renderMode; // setter myInputTime.renderMode = 'native';Set the default in the theme (SCSS)
$inputDateTimeRenderModeOptionDefault: native !default; -
required :boolean
-
Whether the component is required or optional. When required is set to true, an implicit required validator is created using the validator factory -
oj.Validation.validatorFactory(oj.ValidatorFactory.VALIDATOR_TYPE_REQUIRED).createValidator(). Translations specified using thetranslations.requiredattribute and the label associated with the component, are passed through to the options parameter of the createValidator method.When
requiredproperty changes due to programmatic intervention, the component may clear messages and run validation, based on the current state it's in.
Running Validation
- if component is valid when required is set to true, then it runs deferred validation on the value property. This is to ensure errors are not flagged unnecessarily.
- if component is invalid and has deferred messages when required is set to false, then component messages are cleared but no deferred validation is run.
- if component is invalid and currently showing invalid messages when required is set, then
component messages are cleared and normal validation is run using the current display value.
- if there are validation errors, then
valueproperty is not updated and the error is shown. - if no errors result from the validation, the
valueproperty is updated; page author can listen to thevalueChangedevent on the component to clear custom errors.
- if there are validation errors, then
Clearing Messages
- Only messages created by the component are cleared.
messagesCustomproperty is not cleared.
falseimplies that a value is not required to be provided by the user. This is the default. This property set totrueimplies that a value is required to be provided by user and the input's label will render a required icon. Additionally a required validator - oj.RequiredValidator - is implicitly used if no explicit required validator is set. An explicit required validator can be set by page authors using the validators attribute.- Default Value:
false
- Since:
- 0.7
- See:
Names
Item Name Property requiredProperty change event requiredChangedProperty change listener attribute (must be of type function) on-required-changedExamples
Initialize the component with the
requiredattribute:<oj-some-element required></oj-some-element>Customize messages and hints used by implicit required validator when
requiredattribute is set:<oj-some-element required translations='{"required": { "hint": "custom: enter at least 3 alphabets", "messageSummary": "custom: \'{label}\' is Required", "messageDetail": "custom: please enter a valid value for \'{label}\'"}}'> </oj-some-element>Get or set the
requiredproperty after initialization:// getter var rq = myComp.required; // setter myComp.required = false; -
time-picker :Object
-
Note that Jet framework prohibits setting subset of properties which are object types.
For example myInputTime.timePicker = {timeIncrement: "00:30:00:00"}; is prohibited as it will wipe out all other sub-properties for "timePicker" object.
If one wishes to do this [by above syntax or knockout] one will have to get the "timePicker" object, modify the necessary sub-property and pass it to above syntax.
Note that when renderMode is 'native', the only timePicker sub-properties available are showOn and, to a limited extent, timeIncrement.
Names
Item Name Property timePickerProperty change event timePickerChangedProperty change listener attribute (must be of type function) on-time-picker-changedExamples
Initialize the component, overriding some time-picker attributes and leaving the others intact:
<!-- Using dot notation --> <oj-input-time time-picker.time-increment='00:10:00:00'></oj-input-time> <!-- Using JSON notation --> <oj-input-time time-picker='{"timeIncrement":"00:10:00:00"}'></oj-input-time>Get or set the
timePickerproperty after initialization:// Get one var value = myComponent.timePicker.showOn; // Set one, leaving the others intact. Use the setProperty API for // subproperties so that a property change event is fired. myComponent.setProperty('timePicker.showOn', 'image'); // Get all var values = myComponent.timePicker; // Set all. Must list every timePicker key, as those not listed are lost. myComponent.timePicker = { timeIncrement: '00:10:00:00', showOn: 'image', footerLayout: 'now' }; -
time-picker.footer-layout :string
-
Will dictate what content is shown within the footer of the wheel timepicker.
See the time-picker attribute for usage examples.
- Default Value:
""
Supported Values:
Name Type Description ''string Do not show anything 'now'string Show the now button Names
Item Name Property timePicker.footerLayout -
time-picker.show-on :string
-
When the timepicker should be shown.
See the time-picker attribute for usage examples.
- Default Value:
"focus"
Supported Values:
Name Type Description 'focus'string when the element receives focus or when the trigger clock image is clicked. When the picker is closed, the field regains focus and is editable. 'image'string when the trigger clock image is clicked Names
Item Name Property timePicker.showOn -
time-picker.time-increment :string
-
Time increment to be used for InputTime, the format is hh:mm:ss:SS.
Note that when renderMode is 'native', timeIncrement property is limited to iOS and will only take a precision of minutes.
See the time-picker attribute for usage examples.
- Default Value:
"00:05:00:00"
Names
Item Name Property timePicker.timeIncrement -
translations :Object|null
-
A collection of translated resources from the translation bundle, or
nullif this component has no resources. Resources may be accessed and overridden individually or collectively, as seen in the examples.If the component does not contain any translatable resource, the default value of this attribute will be
null. If not, an object containing all resources relevant to the component.If this component has translations, their documentation immediately follows this doc entry.
Names
Item Name Property translationsProperty change event translationsChangedProperty change listener attribute (must be of type function) on-translations-changedExamples
Initialize the component, overriding some translated resources and leaving the others intact:
<!-- Using dot notation --> <oj-some-element translations.some-key='some value' translations.some-other-key='some other value'></oj-some-element> <!-- Using JSON notation --> <oj-some-element translations='{"someKey":"some value", "someOtherKey":"some other value"}'></oj-some-element>Get or set the
translationsproperty after initialization:// Get one var value = myComponent.translations.someKey; // Set one, leaving the others intact. Always use the setProperty API for // subproperties rather than setting a subproperty directly. myComponent.setProperty('translations.someKey', 'some value'); // Get all var values = myComponent.translations; // Set all. Must list every resource key, as those not listed are lost. myComponent.translations = { someKey: 'some value', someOtherKey: 'some other value' }; -
(nullable) translations.ampm-wheel-label :string
-
Label for the AMPM wheel for accessibility.
See the translations attribute for usage examples.
- Default Value:
"AMPM"
Names
Item Name Property translations.ampmWheelLabel -
(nullable) translations.cancel-text :string
-
The text to the cancel button.
See the translations attribute for usage examples.
- Default Value:
"Prev"
Names
Item Name Property translations.cancelText -
(nullable) translations.current-time-text :string
-
The text to display for the current time link.
See the translations attribute for usage examples.
- Default Value:
"Now"
Names
Item Name Property translations.currentTimeText -
(nullable) translations.date-time-range :Object
-
Provides properties to customize the hint and message text used by the implicit datetime range validator associated to the InputDateTime, InputDate, and InputTime components.
See the translations attribute for usage examples.
- Since:
- 0.7
Names
Item Name Property translations.dateTimeRange -
(nullable) translations.date-time-range.hint :Object
-
Provides properties to customize the hint text used by the implicit datetime range validator associated to the InputDateTime, InputDate, and InputTime components.
See the translations attribute for usage examples.
- Since:
- 0.7
Names
Item Name Property translations.dateTimeRange.hint -
(nullable) translations.date-time-range.hint.in-range :string
-
Hint text used by the implicit datetime range validator associated to the InputDateTime, InputDate, and InputTime components. hint.inRange is shown when both min and max are set, and is used to tell the user the allowed number range.
See the translations attribute for usage examples.
- Default Value:
""
- Since:
- 0.7
- See:
Names
Item Name Property translations.dateTimeRange.hint.inRange -
(nullable) translations.date-time-range.hint.max :string
-
Hint text used by the implicit datetime range validator associated to the InputDateTime, InputDate, and InputTime components. hint.max is shown when max is set and min is not set, and is used to tell the user the allowed maximum.
See the translations attribute for usage examples.
- Default Value:
""
- Since:
- 0.7
- See:
Names
Item Name Property translations.dateTimeRange.hint.max -
(nullable) translations.date-time-range.hint.min :string
-
Hint text used by the implicit datetime range validator associated to the InputDateTime, InputDate, and InputTime components. hint.min is shown when min is set and max is not set, and is used to tell the user the allowed minimum.
See the translations attribute for usage examples.
- Default Value:
""
- Since:
- 0.7
- See:
Names
Item Name Property translations.dateTimeRange.hint.min -
(nullable) translations.date-time-range.message-detail :Object
-
Provides properties to customize the error message text used by the implicit datetime range validator associated to the InputDateTime, InputDate, and InputTime components.
See the translations attribute for usage examples.
- Since:
- 0.7
Names
Item Name Property translations.dateTimeRange.messageDetail -
(nullable) translations.date-time-range.message-detail.range-overflow :string
-
Error message text used by the implicit datetime range validator associated to the InputDateTime, InputDate, and InputTime components. messageDetail.rangeOverflow is shown when max is set, and the value is greater than the maximum.
See the translations attribute for usage examples.
- Default Value:
""
- Since:
- 0.7
- See:
Names
Item Name Property translations.dateTimeRange.messageDetail.rangeOverflow -
(nullable) translations.date-time-range.message-detail.range-underflow :string
-
Error message text used by the implicit datetime range validator associated to the InputDateTime, InputDate, and InputTime components. messageDetail.rangeUnderflow is shown when min is set, and the value is less than the minimum.
See the translations attribute for usage examples.
- Default Value:
""
- Since:
- 0.7
- See:
Names
Item Name Property translations.dateTimeRange.messageDetail.rangeUnderflow -
(nullable) translations.date-time-range.message-summary :Object
-
Provides properties to customize the error message summary text used by the implicit datetime range validator associated to the InputDateTime, InputDate, and InputTime components.
See the translations attribute for usage examples.
- Since:
- 0.7
Names
Item Name Property translations.dateTimeRange.messageSummary -
(nullable) translations.date-time-range.message-summary.range-overflow :string
-
Error message summary text used by the implicit datetime range validator associated to the InputDateTime, InputDate, and InputTime components. messageSummary.rangeOverflow is shown when max is set, and the value is greater than the maximum.
See the translations attribute for usage examples.
- Default Value:
""
- Since:
- 0.7
- See:
Names
Item Name Property translations.dateTimeRange.messageSummary.rangeOverflow -
(nullable) translations.date-time-range.message-summary.range-underflow :string
-
Error message summary text used by the implicit datetime range validator associated to the InputDateTime, InputDate, and InputTime components. messageSummary.rangeUnderflow is shown when min is set, and the value is less than the minimum.
See the translations attribute for usage examples.
- Default Value:
""
- Since:
- 0.7
- See:
Names
Item Name Property translations.dateTimeRange.messageSummary.rangeUnderflow -
(nullable) translations.hour-wheel-label :string
-
Label for the Hour wheel for accessibility.
See the translations attribute for usage examples.
- Default Value:
"Hour"
Names
Item Name Property translations.hourWheelLabel -
(nullable) translations.minute-wheel-label :string
-
Label for the Minute wheel for accessibility.
See the translations attribute for usage examples.
- Default Value:
"Minute"
Names
Item Name Property translations.minuteWheelLabel -
(nullable) translations.ok-text :string
-
The text to the OK button.
See the translations attribute for usage examples.
- Default Value:
"OK"
Names
Item Name Property translations.okText -
(nullable) translations.regexp :Object
-
Provides properties to customize the message text used by the implicit regexp validator associated to the InputText and TextArea components.
See the translations attribute for usage examples.
- Since:
- 0.7
Names
Item Name Property translations.regexp -
(nullable) translations.regexp.message-detail :string
-
Provides properties to customize the error message detail used by the implicit regexp validator associated to the InputText and TextArea components.
See the translations attribute for usage examples.
- Since:
- 0.7
Names
Item Name Property translations.regexp.messageDetail -
(nullable) translations.regexp.message-summary :string
-
Provides properties to customize the error message summary used by the implicit regexp validator associated to the InputText and TextArea components.
See the translations attribute for usage examples.
- Since:
- 0.7
Names
Item Name Property translations.regexp.messageSummary -
(nullable) translations.required :Object
-
Provides properties to customize the summary, detail and hint text used by the implicit required validator associated to any editable component that supports the required option.
See the translations attribute and required option for usage examples.
- Since:
- 0.7
Names
Item Name Property translations.required -
(nullable) translations.required.hint :string
-
Hint text used by required validation error.
See the translations attribute for usage examples.
- Default Value:
""
- Since:
- 0.7
- See:
Names
Item Name Property translations.required.hint -
(nullable) translations.required.message-detail :string
-
Message text that describes the details of the required validation error.
See the translations attribute for usage examples.
- Default Value:
""
- Since:
- 0.7
- See:
Names
Item Name Property translations.required.messageDetail -
(nullable) translations.required.message-summary :string
-
Message text for summarizing a required validation error.
See the translations attribute for usage examples.
- Default Value:
""
- Since:
- 0.7
- See:
Names
Item Name Property translations.required.messageSummary -
(nullable) translations.tooltip-time :string
-
Tooltip text for the time icon.
See the translations attribute for usage examples.
- Default Value:
"Select Time"
Names
Item Name Property translations.tooltipTime -
(nullable) translations.tooltip-time-disabled :string
-
Tooltip text for the time icon when the component is disabled.
See the translations attribute for usage examples.
- Default Value:
"Select Time Disabled"
Names
Item Name Property translations.tooltipTimeDisabled -
(readonly) valid :string
PREVIEW: This is a preview API. Preview APIs are production quality, but can be changed on a major version without a deprecation path.
-
The current valid state of the component. It is evaluated on initial render. It is re-evaluated
- after validation is run (full or deferred)
- when messagesCustom is updated, since messagesCustom can be added by the app developer any time.
- when showMessages() is called. Since showMessages() moves the hidden messages into messages shown, if the valid state was "invalidHidden" then it would become "invalidShown".
- when the required property has changed. If a component is empty and has required set, the valid state may be "invalidHidden" (if no invalid messages are being shown as well). If required property is removed, the valid state would change to "valid".
Note: New valid states may be added to the list of valid values in future releases. Any new values will start with "invalid" if it is an invalid state, "pending" if it is pending state, and "valid" if it is a valid state.
- Supports writeback:
true
- Since:
- 4.2.0
Supported Values:
Name Type Description "invalidHidden"string The component has invalid messages hidden and no invalid messages showing. An invalid message is one with severity "error" or higher. "invalidShown"string The component has invalid messages showing. An invalid message is one with severity "error" or higher. "pending"string The component is waiting for the validation state to be determined. The "pending" state is set at the start of the convert/validate process. "valid"string The component is valid Names
Item Name Property validProperty change event validChangedProperty change listener attribute (must be of type function) on-valid-changedExamples
Get
validattribute, after initialization:// Getter: var valid = myComp.valid;Set the
on-valid-changedlistener so you can do work in the ViewModel based on thevalidproperty:<oj-some-element id='username' on-valid-changed='[[validChangedListener]]'> </oj-some-element> <oj-some-element id='password' on-valid-changed='[[validChangedListener]]'> </oj-some-element> <oj-button disabled='[[componentDisabled]]' on-click='[[submit]]'>Submit</oj-button> -- ViewModel -- self.validChangedListener = function (event) { var enableButton; var usernameValidState; var passwordValidState; // update the button's disabled state. usernameValidState = document.getElementById("username").valid; passwordValidState = document.getElementById("password").valid; // this updates the Submit button's disabled property's observable based // on the valid state of two components, username and password. // It is up to the application how it wants to handle the �pending� state // but we think that in general buttons don�t need to be // enabled / disabled based on the "pending" state. enableButton = (usernameValidState !== "invalidShown") && (passwordValidState !== "invalidShown"); self.componentDisabled(!enableButton);; }; -
validators :Array.<(oj.Validator.<string>|oj.Validation.RegisteredValidator)>
-
List of validators used by element along with the implicit component validators when performing validation. Each item is either an instance that duck types oj.Validator, or is an Object literal containing the properties listed below.
Implicit validators are created by the element when certain attributes are present. For example, if the
requiredattribute is set, an implicit oj.RequiredValidator is created. If theminand/ormaxattribute is set, an implicit oj.DateTimeRangeValidator may be created. At runtime when the component runs validation, it combines all the implicit validators with all the validators specified through thisvalidatorsattribute, and runs all of them.Hints exposed by validators are shown in the notewindow by default, or as determined by the 'validatorHint' property set on the
displayOptionsproperty.When
validatorsproperty changes due to programmatic intervention, the element may decide to clear messages and run validation, based on the current state it is in.
Steps Performed Always
- The cached list of validator instances are cleared and new validator hints is pushed to messaging. E.g., notewindow displays the new hint(s).
Running Validation
- if element is valid when validators changes, element does nothing other than the steps it always performs.
- if element is invalid and is showing messages when
validatorschanges then all element messages are cleared and full validation run using the display value on the element.- if there are validation errors, then
valueproperty is not updated and the error is shown. - if no errors result from the validation, the
valueproperty is updated; page author can listen to thevalueChangedevent to clear custom errors.
- if there are validation errors, then
- if element is invalid and has deferred messages when validators changes, it does nothing other than the steps it performs always.
Clearing Messages
- Only messages created by the element are cleared.
messagesCustomproperty is not cleared.
- Default Value:
[]
Properties:
Name Type Argument Description typestring the validator type that has a oj.ValidatorFactory that can be retrieved using the oj.Validation module. For a list of supported validators refer to oj.ValidatorFactory.
optionsObject <optional>
optional Object literal of options that the validator expects. Names
Item Name Property validatorsProperty change event validatorsChangedProperty change listener attribute (must be of type function) on-validators-changedExamples
Initialize the element with validator object literal:
myInputTime.validators = [{ type: 'dateTimeRange', options : { max: 'T14:30:00', min: 'T02:30:00' } }];Initialize the element with multiple validator instances:
var validator1 = new MyCustomValidator({'foo': 'A'}); var validator2 = new MyCustomValidator({'foo': 'B'}); myInputTime.value = 10; myInputTime.validators = [validator1, validator2]; -
value :string
-
The value of the InputTime which should be an ISOString.
- Supports writeback:
true
Names
Item Name Property valueProperty change event valueChangedProperty change listener attribute (must be of type function) on-value-changedExamples
Initialize the element with the
valueattribute:<oj-input-time value='T10:30:00.000'></oj-input-time>Initialize the element with the
valueproperty specified programmatically using oj.IntlConverterUtils.dateToLocalIso :myInputTime.value = oj.IntlConverterUtils.dateToLocalIso(new Date());Get or set the
valueproperty, after initialization:// Getter: returns Today's date in ISOString myInputTime.value; // Setter: sets it to a different date myInputTime.value = "T20:00:00-08:00";
Events
-
ojAnimateEnd
-
Triggered when a default animation has ended.
- "inline-open" - when an inline message container opens or increases in size
- "inline-close" - when an inline message container closes or decreases in size
- "notewindow-open" - when a note window opens
- "notewindow-close" - when a note window closes
- Since:
- 4.0.0
Properties:
All of the event payloads listed below can be found under
event.detail.Name Type Description actionstring The action that triggers the animation. Supported values are: elementElement The element being animated. Examples
Define an event listener for the
ojAnimateEndevent to add any processing after the end of "inline-open" animation:var listener = function( event ) { // Check if this is the end of "inline-open" animation for inline message if (event.detail.action == "inline-open") { // Add any processing here } };Specify an
ojAnimateEndlistener via the DOM attribute:<oj-input-time on-oj-animate-end='[[listener]]'></oj-input-time>Specify an
ojAnimateEndlistener via the JavaScript property:myInputTime.onOjAnimateEnd = listener;Add an
ojAnimateEndlistener via theaddEventListenerAPI:myInputTime.addEventListener('ojAnimateEnd', listener); -
ojAnimateStart
-
Triggered when a default animation is about to start on an element owned by the component.
The default animation can be cancelled by calling
event.preventDefault, followed by a call toevent.detail.endCallback.event.detail.endCallbackshould be called immediately afterevent.preventDefaultif the application merely wants to cancel animation, or it should be called when the custom animation ends if the application is invoking another animation function. Failure to callevent.detail.endCallbackmay prevent the component from working properly.For more information on customizing animations, see the documentation of oj.AnimationUtils.
The default animations are controlled via the theme (SCSS) : // default animations for "notewindow" display option $noteWindowOpenAnimation: (effect: "zoomIn", transformOrigin: "#myPosition") !default; $noteWindowCloseAnimation: (effect: "none") !default; // default animations for "inline" display option $messageComponentInlineOpenAnimation: (effect: "expand", startMaxHeight: "#oldHeight") !default; $messageComponentInlineCloseAnimation: (effect: "collapse", endMaxHeight: "#newHeight") !default;- "inline-open" - when an inline message container opens or increases in size
- "inline-close" - when an inline message container closes or decreases in size
- "notewindow-open" - when a note window opens
- "notewindow-close" - when a note window closes
- Since:
- 4.0.0
Properties:
All of the event payloads listed below can be found under
event.detail.Name Type Description actionstring The action that triggers the animation. Supported values are: elementElement The element being animated. endCallbackfunction():void If the event listener calls event.preventDefault to cancel the default animation, it must call the endCallback function when it finishes its own animation handling and any custom animation has ended. Examples
Define an event listener for the
ojAnimateStartevent to override the default "inline-open" animation:var listener = function( event ) { // Change the "inline-open" animation for inline message if (event.detail.action == "inline-open") { // Cancel default animation event.preventDefault(); // Invoke new animation and call endCallback when the animation ends oj.AnimationUtils.fadeIn(event.detail.element).then(event.detail.endCallback); } };Define an event listener for the
ojAnimateStartevent to cancel the default "notewindow-close" animation:var listener = function( event ) { // Change the "notewindow-close" animation for note window if (ui.action == "notewindow-close") { // Cancel default animation event.preventDefault(); // Call endCallback immediately to indicate no more animation event.detail.endCallback(); };Specify an
ojAnimateStartlistener via the DOM attribute:<oj-input-time on-oj-animate-start='[[listener]]'></oj-input-time>Specify an
ojAnimateStartlistener via the JavaScript property:myInputTime.onOjAnimateStart = listener;Add an
ojAnimateStartlistener via theaddEventListenerAPI:myInputTime.addEventListener('ojAnimateStart', listener);
Methods
-
getProperty(property) → {any}
-
Retrieves a value for a property or a single subproperty for complex properties.
Parameters:
Name Type Description propertystring The property name to get. Supports dot notation for subproperty access. - Since:
- 4.0.0
Returns:
- Type
- any
Example
Get a single subproperty of a complex property:
var subpropValue = myComponent.getProperty('complexProperty.subProperty1.subProperty2'); -
hide() → {void}
-
Hides the timepicker. Note that this function is a no-op when renderMode is 'native'.
Returns:
- Type
- void
-
refresh() → {void}
-
Refreshes the element. Usually called after dom changes have been made.
Returns:
- Type
- void
-
reset() → {void}
-
Resets the component by clearing all messages and messages attributes -
messagesCustom- and updates the component's display value using the attribute value. User entered values will be erased when this method is called.- Since:
- 0.7
Returns:
- Type
- void
Example
Reset component
myComp.reset(); -
setProperties(properties) → {void}
-
Performs a batch set of properties.
Parameters:
Name Type Description propertiesObject An object containing the property and value pairs to set. - Since:
- 4.0.0
Returns:
- Type
- void
Example
Set a batch of properties:
myComponent.setProperties({"prop1": "value1", "prop2.subprop": "value2", "prop3": "value3"}); -
setProperty(property, value) → {void}
-
Sets a property or a single subproperty for complex properties and notifies the component of the change, triggering a [property]Changed event.
Parameters:
Name Type Description propertystring The property name to set. Supports dot notation for subproperty access. valueany The new value to set the property to. - Since:
- 4.0.0
Returns:
- Type
- void
Example
Set a single subproperty of a complex property:
myComponent.setProperty('complexProperty.subProperty1.subProperty2', "someValue"); -
show() → {void}
-
Shows the timepicker
Returns:
- Type
- void
-
showMessages() → {void}
-
Takes all deferred messages and shows them. It then updates the valid property; e.g., if the valid state was "invalidHidden" before showMessages(), the valid state will become "invalidShown" after showMessages().
If there were no deferred messages this method simply returns.
- Since:
- 0.7
Returns:
- Type
- void
Example
Display all messages including deferred ones.
myComp.showMessages(); -
validate() → {Promise.<string>}
PREVIEW: This is a preview API. Preview APIs are production quality, but can be changed on a major version without a deprecation path.
-
Validates the component's display value using the converter and all validators registered on the component and updates the
valueoption by performing the following steps.- All messages are cleared, including custom messages added by the app.
- If no converter is present then processing continues to next step. If a converter is present, the UI value is first converted (i.e., parsed). If there is a parse error then the messages are shown.
- If there are no validators setup for the component the
valueoption is updated using the display value. Otherwise all validators are run in sequence using the parsed value from the previous step. The implicit required validator is run first if the component is marked required. When a validation error is encountered it is remembered and the next validator in the sequence is run. - At the end of validation if there are errors, the messages are shown.
If there were no errors, then the
valueoption is updated.
- Since:
- 4.0.0
Returns:
Promise resolves to "valid" if there were no converter parse errors and the component passed all validations. The Promise resolves to "invalid" if there were converter parse errors or if there were validation errors.- Type
- Promise.<string>
Examples
Validate component using its current value.
// validate display value and shows messages if there are any to be shown. myComp.validate();Validate component and use the Promise's resolved state.
myComp.validate().then( function(result) { if(result === "valid") { submitForm(); } });