Element: <oj-progress>

Oracle® JavaScript Extension Toolkit (JET)
5.0.0

E90577-01

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.


PREVIEW: This is a preview API. Preview APIs are production quality, but can be changed on a major version without a deprecation path.

Version:
  • 5.0.0
Since:
  • 1.0.0
Module:
  • ojprogress

JET Progress

The JET Progress element allows a user to display progress of an operation in a rectangular horizontal or circular meter. If a developer does not wish to display the exact value, a value of '-1' can be passed in to display an indeterminate value.
<oj-progress value='{{progressValue}}'></oj-progress>

Touch End User Information

This element has no touch interaction.

Keyboard End User Information

This element has no keyboard interaction.

Styling

The following CSS classes can be applied by the page author as needed.

Class Description Example
oj-progress-bar-embedded Optional class that can be set on a oj-progress bar element to style an embedded progress bar within a web application or dialog.
<div class='oj-web-applayout-page'>
 <header class='oj-web-applayout-header'></header>
 <oj-progress class='oj-progress-bar-embedded' value='{{loadingValue}}'>
 </oj-progress>
</div>
oj-progress-bar-start-label Optional class that can be set on a div after the oj-progress element. This div contains the start text to display underneath the oj-progress bar.
<div id='progress-container'>
 <oj-progress value='{{loadingValue}}'></oj-progress>
 <div class='oj-progress-bar-start-label'>0%</div>
 <div class='oj-progress-bar-end-label'>100%</div>
</div>
oj-progress-bar-end-label Optional class that can be set on a div after the oj-progress element. This div contains the end text to display underneath the oj-progress bar.
<div id='progress-container'>
 <oj-progress value='{{loadingValue}}'></oj-progress>
 <div class='oj-progress-bar-start-label'>0%</div>
 <div class='oj-progress-bar-end-label'>100%</div>
</div>

Accessibility

If this element is being used to describe the loading process of a particular region of a page, then the aria-describedby attribute must point to the id of the oj-progress and aria-busy = "true" must be added to the region until the loading is complete.

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 slot attribute 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 slot attribute will be moved to the default slot, also known as a regular child.

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 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

max :number

The maximum allowed value. The element's max attribute is used if it is provided, otherwise the default value of 100 is used.
Default Value:
  • 100
Names
Item Name
Property max
Property change event maxChanged
Property change listener attribute (must be of type function) on-max-changed
Examples

Initialize the Progress with the max attribute specified

<oj-progress max='220'></oj-progress>

Get or set the max property after initialization

//Get progress max
var max = myProgress.max;

//Set progress max
myProgress.max = 200;

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) on-translations-changed
Examples

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 translations property 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'
};

translations.aria-indeterminate-progress-text :string

Accessible text read by a screen reader while an indeterminate oj-progress is in progress.

See the translations attribute for usage examples.

Default Value:
  • "In Progress"
Since:
  • 4.0.0
Names
Item Name
Property translations.ariaIndeterminateProgressText

type :string

The shape of the Progress.
Supported Values:
Name Type Description
"bar" string displays progress in a rectangular horizontal meter
"circle" string displays progress in a circular meter
Default Value:
  • "bar"
Since:
  • 3.0
Names
Item Name
Property type
Property change event typeChanged
Property change listener attribute (must be of type function) on-type-changed
Examples

Initialize the Progress with the type attribute specified

<oj-progress type='circle'></oj-progress>

Get or set the type property after initialization

//Get progress type
var type = myProgress.type;

//Set progress type
myProgress.type= 'bar';

value :number

The value of the Progress. The element's value attribute is used if it is provided, otherwise the default value of 0 is used. For indeterminate Progress, set value to -1.
Default Value:
  • 0
Supports writeback:
  • true
Names
Item Name
Property value
Property change event valueChanged
Property change listener attribute (must be of type function) on-value-changed
Examples

Initialize the Progress with the value attribute specified

<oj-progress value='{{progressVal}}'></oj-progress>

Get or set the value property after initialization

//Get progress value
var value = myProgress.value;

//Set progress value
myProgress.value = 10;

Methods

getProperty(property) → {*}

Retrieves a value for a property or a single subproperty for complex properties.
Parameters:
Name Type Description
property string The property name to get. Supports dot notation for subproperty access.
Since:
  • 4.0.0
Returns:
Type
*
Example

Get a single subproperty of a complex property:

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

refresh() → {void}

Refreshes the component.
Returns:
Type
void

setProperties(properties) → {void}

Performs a batch set of properties.
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 single subproperty for complex properties and notifies the component of the change, triggering a [property]Changed event.
Parameters:
Name Type Description
property string The property name to set. Supports dot notation for subproperty access.
value * 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");