Element: <oj-slider>

Oracle® JavaScript Extension Toolkit (JET)
9.0.0

F24343-01

Signature:

class ojSlider

QuickNav

Attributes

JET Custom Elements

JET components are implemented as custom HTML elements. In addition to the component attributes documented in this page, JET components also support standard HTML global attributes like id and aria-label.

The JET data binding syntax can be used to define both component and global attributes through the use of dynamically evaluated expressions. All attributes (component and global) support attribute-level binding by prefixing the attribute name with ":" (e.g. :id="[...]"). When using attribute-level binding, all expression values are treated as strings. Additionally, component attributes support property-level binding by using the attribute name directly with no ":" prefix. When using property-level binding, the expressions should evaluate to the types documented by the corresponding attributes. Property-level binding is strongly recommended over attribute-level binding for component attributes.

A detailed description of working with custom HTML elements can be found in: JET Custom Element Usage.


Version:
  • 9.0.0
Since:
  • 0.7.0
Module:
  • ojslider

Module usage

See JET Module Loading for an overview of module usage within JET.

Typescript Import Format
//To typecheck the element APIs, import as below.
import {ojSlider} from "ojs/ojslider";

//For the transpiled javascript to load the element's module, import as below
import "ojs/ojslider";

JET In Typescript

A detailed description of working with JET elements and classes in your typescript project can be found at: JET Typescript Usage.


JET Slider Component

Description: The oj-slider component enhances an HTML input element into an interactive slider.

The numerical value attribute determines the current value of the slider, and thus affects the position of the slider thumb. The value should be between the min and max attribute values.

The step attribute of the slider specifies the interval between thumb stops. For example, if min is set to 0 and max is set to 10, a step value of 2 would allow the thumb to be positioned at 0, 2, 4, 6, 8, and 10.

The orientation attribute defaults to "horizontal". Set orientation to "vertical" for a vertical slider (one where the thumb travels along the vertical axis).

The type attribute is used to effect the rendered style of the slider. The type attribute defaults to "fromMin", which will style the value bar from the minimum value to the slider thumb. The type attribute to either "single" or "fromMax" - this will alter the rendered style of the slider's bar value.

Set the disabled attribute true to display a slider that displays a value but does not allow interaction.

Use style attributes on the oj-slider element to set a horizontal slider's width or a vertical slider's height.

Use the transient-value attribute to access slider value changes during slider thumb repositioning.

Note that the range value for the type attribute is not part of the initial (4.0) release of the custom element slider.

Touch End User Information

Target Gesture Action
Slider Bar Tap Reposition the thumb.
Slider Thumb Swipe Reposition the thumb.

Keyboard End User Information

The JET slider supports keyboard actions for thumb movement:

Target Key Use
Slider Tab Places focus on the slider component. If hints, title or messages exist in a notewindow, pop up the notewindow.
Slider RightArrow Scrolls right on a horizontal slider, scrolls up on a vertical slider.
Slider LeftArrow Scrolls left on a horizontal slider, scrolls down on a vertical slider.
Slider UpArrow Scrolls right on a horizontal slider, scrolls up on a vertical slider.
Slider DownArrow Scrolls left on a horizontal slider, scrolls down on a vertical slider.
Slider PageUp Scrolls one page right on a horizontal slider, scrolls one page up on a vertical slider.
A page is defined as 20% of the range of the slider.
Slider PageDown Scrolls one page left on a horizontal slider, scrolls one page down on a vertical slider.
Slider End Scrolls to the right end on a horizontal slider, scrolls to the bottom on a vertical slider.
Slider Home Scrolls to the left end on a horizontal slider, scrolls to the top on a vertical slider.

Accessibility

The slider component is accessible - it sets and maintains the appropriate aria- attributes, including aria-valuenow, aria-valuemax, aria-valuemin and aria-orientation.

Label and Slider

It is up to the application developer to associate the oj-label to the oj-slider element. For accessibility, you should associate a oj-label element with the oj-slider element by putting an id on the oj-slider element, and then setting the for attribute on the oj-label to be the slider element's id.

In addition, the slider thumb element can be accessed programmatically. This approach may be necessary to ensure accessibility conformance. For example, if the slider controls another element that is in a remote area of the page, then the aria-controls attribute for the slider thumb should be set.

Consider an example where you may need to set additional attributes for accessibility reasons. Suppose there is another component that is in a remote area of the page that controlled by the slider. Assume that the id of the remote element is "idOfRemoteElement". Below we show how to access the thumb element in order to set the aria-controls attribute of the thumb to point to the id ("idOfRemoteElement") of the remote html element:



    var thumb0 = myComponent.querySelectorAll('.oj-slider-thumb')[0];
    thumb0.setAttribute(aria-controls, "idOfRemoteElement");

Disabled content: JET supports an accessible luminosity contrast ratio, as specified in WCAG 2.0 - Section 1.4.3 "Contrast", in the themes that are accessible. (See the "Theming" chapter of the JET Developer Guide for more information on which themes are accessible.) Note that Section 1.4.3 says that text or images of text that are part of an inactive user interface component have no contrast requirement. Because disabled content may not meet the minimum contrast ratio required of enabled content, it cannot be used to convey meaningful information.

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.

Styling Classes

.oj-focus-highlight
Under normal circumstances this class is applied automatically. It is documented here for the rare cases that an app developer needs per-instance control.

The oj-focus-highlight class applies focus styling that may not be desirable when the focus results from pointer interaction (touch or mouse), but which is needed for accessibility when the focus occurs by a non-pointer mechanism, for example keyboard or initial page load.

The application-level behavior for this component is controlled in the theme by the $focusHighlightPolicy SASS variable; however, note that this same variable controls the focus highlight policy of many components and patterns. The values for the variable are:

nonPointer: oj-focus-highlight is applied only when focus is not the result of pointer interaction. Most themes default to this value.
all: oj-focus-highlight is applied regardless of the focus mechanism.
none: oj-focus-highlight is never applied. This behavior is not accessible, and is intended for use when the application wishes to use its own event listener to precisely control when the class is applied (see below). The application must ensure the accessibility of the result.

To change the behavior on a per-instance basis, the application can set the SASS variable as desired and then use event listeners to toggle this class as needed.
Example
<oj-slider class="oj-focus-highlight">
  <!-- Content -->
</oj-slider>
.oj-form-control-full-width
Changes the max-width to 100% so that form components will occupy all the available horizontal space.
Example
<oj-slider class="oj-form-control-full-width">
</oj-slider>

Category: Max Width

In the Redwood theme the default max width of a text field is 100%. These max width convenience classes are available to create a medium or small field.
The class is applied to the root element.

Classes:

.oj-form-control-max-width-sm
.oj-form-control-max-width-md

Example
<oj-slider class="oj-form-control-max-width-md"></oj-slider>

Category: Width

In the Redwood theme the default width of a text field is 100%. These width convenience classes are available to create a medium or small field.
The class is applied to the root element.

Classes:

.oj-form-control-width-sm
.oj-form-control-width-md

Example
<oj-slider class="oj-form-control-width-md"></oj-slider>

Slots

JET components that allow child content support slots. Please see the slots section of the JET component overview doc for more information on allowed slot content and slot types.

contextMenu

The contextMenu slot is set on the oj-menu within 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 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.

Attributes

(nullable) described-by :string

The oj-label sets the described-by attribute programmatically on the form component. This attribute is not meant to be set by an application developer directly. The described-by is copied to the aria-describedby attribute on the component's inner dom element, and it is needed for accessibility.
Since:
  • 4.0.0
Names
Item Name
Property describedBy
Property change event describedByChanged
Property change listener attribute (must be of type function, see Events and Listeners for additional information.) on-described-by-changed

disabled :boolean

Whether the component is disabled. The default is false.

When the disabled property 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 value property is updated. Page authors can listen to the valueChanged event 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.
  • when enabled component is disabled then no validation is run and the component appears disabled.

Default Value:
  • false
Since:
  • 0.7.0
Names
Item Name
Property disabled
Property change event disabledChanged
Property change listener attribute (must be of type function, see Events and Listeners for additional information.) on-disabled-changed

display-options :Object

Display options for auxiliary content that determines whether or not it should be displayed.

The sub-properties of the display-options configure aspects of visual behavior such as where types of information is shown. The values of these sub-properties are specified either as an array of strings or a string. When an array is specified the first display option takes precedence over the second display option and so on.

When display-options changes due to programmatic intervention, the component updates its display to reflect the updated choices. For example, if you don't want to show the converter hint, set the display-options.converter-hint to 'none'.

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 displayOptions
Property change event displayOptionsChanged
Property change listener attribute (must be of type function, see Events and Listeners for additional information.) on-display-options-changed

display-options.converter-hint :Array<'placeholder'|'notewindow'|'none'>|'placeholder'|'notewindow'|'none'

Display options for auxiliary converter hint text that determines whether or not it should be displayed. If you don't want to show the converter hint, set it to 'none'. Otherwise, in the Redwood theme it will show according to the user-assistance-density options.
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 auxiliary help instruction text that determines where it should be displayed in relation to the component.
Deprecated:
Since Description
9.0.0 If you want none, remove help-instruction attribute.
Default Value:
  • ['notewindow']
Since:
  • 9.0.0
Names
Item Name
Property displayOptions.helpInstruction

display-options.messages :Array<'inline'|'notewindow'|'none'>|'inline'|'notewindow'|'none'

Display options for auxiliary message text that determines whether or not it should be displayed. If you don't want to show messages, set it to 'none'. Otherwise, in the Redwood theme it will show according to the user-assistance-density options.
Default Value:
  • ['inline']
Since:
  • 0.7
Names
Item Name
Property displayOptions.messages

display-options.validator-hint :Array<'notewindow'|'none'>|'notewindow'|'none'

Display options for auxiliary validator hint text that determines whether or not it should be displayed. If you don't want to show the validator hint, set it to 'none'. Otherwise, in Redwood theme it will show according to the user-assistance-density options.
Default Value:
  • ['notewindow']
Since:
  • 0.7
Names
Item Name
Property displayOptions.validatorHint

help :Object

Form component help information.
Since:
  • 0.7.0
Names
Item Name
Property help
Property change event helpChanged
Property change listener attribute (must be of type function, see Events and Listeners for additional information.) 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 displayOptions attribute. When the help.instruction property changes the component refreshes to display the updated information.

JET takes the help instruction text and creates a notewindow with the text. The notewindow pops up when the field takes focus and closes when the field loses focus.

How is help.instruction better than the html 'title' attribute? The html 'title' attribute only shows up as a tooltip on mouse over, not on keyboard and not in a mobile device. So the html 'title' 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 the 'title' window. For these reasons, the JET EditableValue components do not use the HTML's 'title' attribute and instead use the help.instruction attribute.

To include formatted text in the help.instruction, format the string using html tags. For example the help.instruction might look like:

<oj-some-element help.instruction="<html>Enter <b>at least</b> 6 characters</html>"></oj-some-element>
If you use formatted text, it should be accessible and make sense to the user if formatting wasn't there.
Default Value:
  • ""
Since:
  • 4.0.0
Names
Item Name
Property help.instruction

help-hints :Object

Represents hints to render help information on the label of the editable component. This is used when an oj-form-layout creates labels for its editable value component children. Also when an editable value component (inside or outside oj-form-layout) creates a label for itself (if you set labelEdge), these hints will be used to render the help information. However, please note that, help information will not be rendered if the label is created inside the input field (labelEdge ='inside').

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 helpHints
Property change event helpHintsChanged
Property change listener attribute (must be of type function, see Events and Listeners for additional information.) on-help-hints-changed

(nullable) 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

(nullable) 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

label-edge :('inside'|'none'|'provided')

Specifies how the label of the component is created when the label-hint attribute is set on the component.

The default value varies by theme, and it works well for the theme in most cases. If the component is in an oj-form-layout, and the label-edge attribute on oj-form-layout is set to an explicit value, the label-edge attribute on all form controls should also be set to an explict value. For example, if the label-edge attribute on oj-form-layout is set to "start" or "top", the label-edge attribute of all form controls should be set to "provided".

Supported Values:
Value Description
inside The component creates the label using the label-hint attribute.

For text input components (such as oj-input-text), the label floats over the input element but moves up on focus or when the component has a value.

For non-text input components (such as oj-checkboxset), the label is created at the top of the component and doesn't move.

The help-hints attribute will be ignored. No help related information will be rendered on the label.

none The component will not have a label, regardless of whether it's in an oj-form-layout or not.

If the component has a label-hint attribute but no labelled-by, aria-label, or aria-labelledby attribute, the label-hint value will be used as the aria-label.

Note that if the component already has an external label, "none" should not be specified and "provided" should be used instead. Otherwise it may end up with conflicting label information.

provided Label is provided by the parent if the parent is an oj-form-layout.

oj-form-layout provides the label using the label-hint from the form control and the label-edge from oj-form-layout.

If there is no oj-form-layout, use an oj-label.

Since:
  • 8.0.0
Names
Item Name
Property labelEdge
Property change event labelEdgeChanged
Property change listener attribute (must be of type function, see Events and Listeners for additional information.) on-label-edge-changed

label-hint :string

Represents a hint for rendering a label on the component.

This is used in combination with the label-edge attribute to control how the label should be rendered.

When label-edge is "provided", it gives a hint to oj-form-layout parent element to create an oj-label element for the component. When the label-hint attribute changes, oj-form-layout element refreshes to display the updated label information.

When label-edge is "inside", it gives a hint to the component itself to render a label.

When label-edge is "none", and if the component has no labelled-by, aria-label, or aria-labelledby attribute, the label-hint value will be used as the aria-label.

Default Value:
  • ""
Since:
  • 4.1.0
Names
Item Name
Property labelHint
Property change event labelHintChanged
Property change listener attribute (must be of type function, see Events and Listeners for additional information.) on-label-hint-changed

labelled-by :string|null

The oj-label sets the labelledBy property programmatically on the form component to make it easy for the form component to find its oj-label component (a document.getElementById call.)

The application developer should use the 'for'/'id api to link the oj-label with the form component; the 'for' on the oj-label to point to the 'id' on the input form component. This is the most performant way for the oj-label to find its form component.

Default Value:
  • null
Since:
  • 7.0.0
Names
Item Name
Property labelledBy
Property change event labelledByChanged
Property change listener attribute (must be of type function, see Events and Listeners for additional information.) on-labelled-by-changed

(nullable) max :number

The maximum value of the slider. The max must not be less than the min, or else an Error is thrown during initialization.
Default Value:
  • null
Since:
  • 0.7.0
Names
Item Name
Property max
Property change event maxChanged
Property change listener attribute (must be of type function, see Events and Listeners for additional information.) on-max-changed

messages-custom :Array.<oj.Message>

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 messagesCustom back 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.

In the Redwood theme, the Message summary is not displayed to the user, so make sure to have a Message detail set in your Message object.

Default Value:
  • []
Supports writeback:
  • true
Since:
  • 0.7.0
Names
Item Name
Property messagesCustom
Property change event messagesCustomChanged
Property change listener attribute (must be of type function, see Events and Listeners for additional information.) on-messages-custom-changed

(nullable) min :number

The minimum value of the slider. The min must not be greater than the max, or else an Error is thrown during initialization.
Default Value:
  • null
Since:
  • 0.7.0
Names
Item Name
Property min
Property change event minChanged
Property change listener attribute (must be of type function, see Events and Listeners for additional information.) on-min-changed

orientation :horizontal|vertical

Specify the orientation of the slider.
Supported Values:
Value Description
horizontal Orient the slider horizontally.
vertical Orient the slider vertically.
Default Value:
  • "horizontal"
Since:
  • 0.7.0
Names
Item Name
Property orientation
Property change event orientationChanged
Property change listener attribute (must be of type function, see Events and Listeners for additional information.) on-orientation-changed

(nullable) step :number

Determines the size or amount of each interval or step the slider takes between min and max. The full specified value of the range (max - min) should be divisible by step.
Default Value:
  • 1
Since:
  • 0.7.0
Names
Item Name
Property step
Property change event stepChanged
Property change listener attribute (must be of type function, see Events and Listeners for additional information.) on-step-changed

(readonly) transient-value :number

The transientValue is the read-only attribute for retrieving the transient value from the slider.

The transientValue updates to display the transient changes of the slider thumb value (subject to the step constraints). The difference in behavior is transientValue will be updated as the thumb is sliding, where as value is updated only after the thumb is released (or after a key press).

This is a read-only attribute so page authors cannot set or change it directly.

Supports writeback:
  • true
Since:
  • 5.0
Names
Item Name
Property transientValue
Property change event transientValueChanged
Property change listener attribute (must be of type function, see Events and Listeners for additional information.) on-transient-value-changed

translations :object|null

A collection of translated resources from the translation bundle, or null if 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 translations
Property change event translationsChanged
Property change listener attribute (must be of type function, see Events and Listeners for additional information.) on-translations-changed

(nullable) translations.invalid-step :string

Invalid step value.

See the translations attribute for usage examples.

Default Value:
  • "Invalid step; step must be > 0"
Since:
  • 1.1.1
Names
Item Name
Property translations.invalidStep

(nullable) translations.max-min :string

Max is greater than min.

See the translations attribute for usage examples.

Default Value:
  • "Max must not be less than min"
Since:
  • 1.1.1
Names
Item Name
Property translations.maxMin

(nullable) translations.no-value :string

Missing value exception.

See the translations attribute for usage examples.

Default Value:
  • "ojSlider has no value"
Since:
  • 1.1.1
Names
Item Name
Property translations.noValue

(nullable) translations.option-num :string

The option is not a number.

See the translations attribute for usage examples.

Default Value:
  • "{option} option is not a number"
Since:
  • 1.1.1
Names
Item Name
Property translations.optionNum

(nullable) translations.value-range :string

Value outside min to max range.

See the translations attribute for usage examples.

Default Value:
  • "Value must be within min to max range"
Since:
  • 1.1.1
Names
Item Name
Property translations.valueRange

(nullable) type :fromMin|fromMax|single

The slider type determines how the value is represented in the UI.
Supported Values:
Value Description
fromMax A single-thumb slider where the value bar goes from the slider thumb to the slider max.
fromMin A single-thumb slider where the value bar goes from the slider min to the slider thumb.
single A single-thumb slider where the value bar has no additional styling.
Default Value:
  • "fromMin"
Since:
  • 0.7.0
Names
Item Name
Property type
Property change event typeChanged
Property change listener attribute (must be of type function, see Events and Listeners for additional information.) on-type-changed

user-assistance-density :('reflow'|'efficient'|'compact')

Specifies the density of the form component's user assistance presentation. It can be shown inline with reserved rows to prevent reflow if a user assistance text shows up, inline without reserved rows, or it can be shown compactly in a popup instead.

The oj-form-layout provides its user-assistance-density attribute value and its default value and the form components consume it if it is not already set explicitly. For example, if oj-form-layout is set or defaults to user-assistance-density='efficient', all the form components it contains will be user-assistance-density='efficient' by default. This is why when a form component is inside an oj-form-layout component its user-assistance-density is 'efficient', and when it is not inside an oj-form-layout component, its user-assistance-density is 'reflow'.

A form component can explicitly set its own user-assistance-density attribute which will take precedence.

This attribute is ignored in the Alta theme.

Supported Values:
Value Description
compact Messages, help, hints, and required will not be shown inline; they will show in a mode that keeps the screen more compact, like a popup for the messages, and a required icon to indicate Required.
efficient Messages, help, hints, and required are all shown inline under the field with reserved space.
reflow Messages, help, hints, and required are all shown inline under the field with no reserved space.
Default Value:
  • "reflow"
Since:
  • 9.0.0
Names
Item Name
Property userAssistanceDensity
Property change event userAssistanceDensityChanged
Property change listener attribute (must be of type function, see Events and Listeners for additional information.) on-user-assistance-density-changed

(readonly) valid :valid|pending|invalidHidden|invalidShown

The current valid state of the component. It is evaluated on initial render. It is re-evaluated

  • after each validator (validators or async-validators) 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.

Supported Values:
Value Description
invalidHidden The component has invalid messages hidden and no invalid messages showing. An invalid message is one with severity "error" or higher.
invalidShown The component has invalid messages showing. An invalid message is one with severity "error" or higher.
pending 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 The component is valid
Supports writeback:
  • true
Since:
  • 4.2.0
Names
Item Name
Property valid
Property change event validChanged
Property change listener attribute (must be of type function, see Events and Listeners for additional information.) on-valid-changed

(nullable) value :number

The numerical value of the slider.

Note that the value attribute should be compatible with the type attribute, as described above.

Default Value:
  • 0
Supports writeback:
  • true
Since:
  • 0.7.0
Names
Item Name
Property value
Property change event valueChanged
Property change listener attribute (must be of type function, see Events and Listeners for additional information.) on-value-changed

Events

ojAnimateEnd

Triggered when a default animation has ended.
Properties:

All of the event payloads listed below can be found under event.detail. See Events and Listeners for additional information.

Name Type Description
action string The action that triggers the animation.

Supported values are:
  • "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
element Element The element being animated.
Since:
  • 4.0.0

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 to event.detail.endCallback. event.detail.endCallback should be called immediately after event.preventDefault if 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 call event.detail.endCallback may 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
$popupTailOpenAnimation: (effect: "zoomIn", transformOrigin: "#myPosition") !default;
$popupTailCloseAnimation: (effect: "none") !default;

// default animations for "inline" display option
$messageComponentInlineOpenAnimation: (effect: "expand", startMaxHeight: "#oldHeight") !default;
$messageComponentInlineCloseAnimation: (effect: "collapse", endMaxHeight: "#newHeight") !default;
Properties:

All of the event payloads listed below can be found under event.detail. See Events and Listeners for additional information.

Name Type Description
action string The action that triggers the animation.

Supported values are:
  • "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
element Element The element being animated.
endCallback function():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.
Since:
  • 4.0.0

Methods

getProperty(property) : {any}

Retrieves the value of a property or a subproperty. The return type will be the same as the type of the property as specified in this API document. If the method is invoked with an incorrect property/subproperty name, it returns undefined.
Parameters:
Name Type Description
property string 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:

let subpropValue = myComponent.getProperty('complexProperty.subProperty1.subProperty2');

refresh() : {void}

Called when the DOM underneath the component changes requiring a re-render of the component. An example is when the id for the input changes.

Another time when refresh might be called is when the locale for the page changes. When it changes, attributes used by its converter and validator that are locale specific, its hints, messages and translations will be updated.

When refresh method is called, the component may take various steps such as clearing messages, running validation etc., based on the state it is in.

Steps Performed Always

  • The converter and validators used by the component are reset, and new converter and validator hints is pushed to messaging. E.g., notewindow displays the new hint(s).

Running Validation

  • if component is valid when refresh() is called, the display value is refreshed if component has a converter set.
  • if component is invalid and is showing messages when refresh() is called, then all component messages are cleared and full validation run using the display value on the component.
    • if there are validation errors, then value attribute is not updated and the error is shown.
    • if no errors result from the validation, the value attribute is updated; page author can listen to the valueChanged event to clear custom errors.
  • if component is invalid and has deferred messages when refresh() is called, then all component messages are cleared and deferred validation is run.

Clearing Messages

  • If clearing messages only those created by the component are cleared.
  • messagesCustom attribute is not cleared.

Since:
  • 0.7.0
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.0
Returns:
Type
void

setProperties(properties) : {void}

Performs a batch set of properties. The type of value for each property being set must match the type of the property as specified in this API document.
Parameters:
Name Type Description
properties Object 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 subproperty (of a complex property) and notifies the component of the change, triggering a [property]Changed event. The value should be of the same type as the type of the attribute mentioned in this API document.
Parameters:
Name Type Description
property string The property name to set. Supports dot notation for subproperty access.
value any 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");

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.0
Returns:
Type
void