Element: <oj-popup>

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.1.0
Module:
  • ojpopup

JET Popup Component

Description: Themeable, WAI-ARIA-compliant popup that can display arbitrary content.

A JET popup can be created from custom element <oj-popup> syntax. This element will become the root - outer chrome of the popup. The content of the popup will be relocated under an element marked with the .oj-popup-content selector. Dynamic content can be inserted under the element identified by the .oj-popup-content selector. However, page developers are encouraged to create their own content element to anchor dynamic content changes versus using .oj-popup-content as the marker selector.

<oj-popup id="popup">
  <span class="mycontent">
    Hello World!
  </span class="mycontent">
</oj-popup>

The following is an example of dynamically changing the content of the popup defined above.

var content = popup.querySelector( ".mycontent" );
content.textContent = "Hello Universe!";

Touch End User Information

Target Gesture Action
Outside popup or launcher Tap Close the popup.

Disabled items do not allow any touch interaction.

Keyboard End User Information

Target Key Action
Focus within Popup Tab or Shift + Tab Navigate the content of the popup. Close the open popup if there are no tab stops in the popup.
F6 Move focus to the launcher for a popup with modeless modality. Close the open popup if the modality is modal.
Esc Close the open popup.
Popup Launcher F6 Move focus to the first tab stop within the open popup. If there is not a tab stop within the content, focus is established on the popup.


Accessibility

For WAI-ARIA compliance, JET automatically adds role="tooltip" to the root popup dom element if not already specificed. This is not a component property but rather the standard html role attribute. Depending on how the popup is used in the page, the page developer should choose from the following:

  • "tooltip" defines contextual popup that displays a description for an element.
  • "dialog" defines an application window that is designed to interrupt the current processing of an application in order to prompt the user to enter information or require a response.
  • "alertdialog" defines type of dialog that contains an alert message, where initial focus goes to an element within the dialog.
The popup also adds the aria-describedby="popup-id" attribute to the assocaited launcher while the popup is open.

On platforms that support voice over mode (VO), the popup injects anchor tags "skip links" into the document for navigation. Skip links are not visible but read in VO mode. Two skip links are injected into the document when a popup is disclosed:
  • A close link is injected as a sibling to the popup's content. Activation of this link will close the popup.
  • For cases where the popup doesn't steal focus when it's open, a content navigation skip link is injected as a sibling to the launcher (first required argument of the open method). If the launcher selector targets a sub-element of the launcher, the skip link could be injected under the launcher, which can be problematic for oj-button as skip link activation will also activate the associated launcher.

One point often overlooked is making the gestures that launch a popup accessible. There are no constraints to what events a page developer might choose to trigger opening a popup. The choice should be accessible for screen reader users. Page developers should take care when using mouse events to trigger opening of a popup. This is especially important if the content of the popup can't be derived from other visible areas on the page. In cases that mouseover, mouseout, mouseenter, mouseleave and hover events are used to launch popups, there needs to be a keyboard functional equivalency.

See also the oj-focus-highlight discussion.

Reparenting

When popups are open, they will be reparented in the document and reparented back when closed. When open, the location of the popup within the document will be in context of how it's used. Popups open from other popups will be relocated in the document into the nearest parent popup's layer. The popups layer defines its z-index weight "stacking context". The ojPopup's layer is marked with the "oj-popup-layer" style. The context of opening is defined by the launcher argument passed to the open method. If not open from another popup, the popup will be reparented to a container in the document body. Popups of the same type are assigned the same z-index values. The layering between peer popups reflect the opening order. The popup that has active focus will be assigned a greater z-index value. This is applied to the popup's layer by way of the "oj-focus-within" pseudo selector applied with "oj-popup-layer" selector. The page author has control over z-index weights by way of the "oj-popup-layer" selector.

There are known caveats with this design. However, these scenarios are considered "bad use" based on our JET popup strategy.

  1. Events raised within the popup will not bubble up to the popup's original ancestors. Instead, listeners for popup events should be applied to either the popup's root element, or the document.
  2. Likewise, developers should not use CSS descendant selectors, or similar logic, that assumes that the popup will remain a child of its original parent.
  3. Popups containing iframes are problematic. The iframe elements "may" fire a HTTP GET request for its src attribute each time the iframe is reparented in the document.
  4. In some browsers, reparenting a popup that contains elements having overflow, will cause these overflow elements to reset their scrollTop.

Styling

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

Class Description Example
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.

<oj-popup class="oj-focus-highlight">
 <input id="blueopt" type="checkbox" value="blue">
 <label for="blueopt">Blue</label>
</oj-popup>

Event Handling

  • ojBeforeClose(event) - Triggered before a popup closes. Event can prevent closing the popup; However, there are cases the framework must veto, such as when the popup is destroyed.
  • ojBeforeOpen(event) - Triggered before a popup opens. Event can prevent opening the popup.
  • ojClose(event) - Triggered after the popup has closed.
  • ojFocus(event) - Triggered when initial focus is established on opening, depending on the value of the initalFocus property, or F6 focus toggle from the associated launcher.
  • ojOpen(event) - Triggered after the popup has been made visible.

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

auto-dismiss :string

Defines conditions that will cause an open popup to auto close dismiss. A value of focusLoss defines the dismissal condition where focus has left the content of the popup or from the associated launcher or if what the popup is aligned to is not fully visible within an overflow area.
Supported Values:
Name Type Description
"focusLoss" string defines auto dismissal behavior when focus leaves the content of the popup or associated launcher. In addition, if what the popup is positioned to is not visible within an overflow area, the popup will auto close dismiss.
"none" string disables auto dismissal behaviors.
Default Value:
  • 'focusLoss'
Names
Item Name
Property autoDismiss
Property change event autoDismissChanged
Property change listener attribute (must be of type function) on-auto-dismiss-changed
Examples

Initialize the popup with auto-dismiss attribute specified:

<oj-popup auto-dismiss="focusLoss" ></oj-popup>

Get or set the autoDismiss property, after initialization:

// getter
var autoDismiss = myPopup.autoDismiss;
// setter
myPopup.autoDismiss = "none";

chrome :string

Defines the presents of border, shadow and background color of the root popup dom. Value of none applies the oj-popup-no-chrome selector defined by the active theme to the root dom of the popup to remove the default chrome.
Supported Values:
Name Type Description
"default" string describes the popups border, shadow, and background color defined by the active theme.
"none" string turns off the outer chrome defined by the active theme.
Default Value:
  • 'default'
Names
Item Name
Property chrome
Property change event chromeChanged
Property change listener attribute (must be of type function) on-chrome-changed
Examples

Initialize the popup with chrome attribute specified:

<oj-popup chrome="none" ></oj-popup>

Get or set the chrome property, after initialization:

// getter
var chrome = myPopup.chrome;

// setter
myPopup.chrome = "none";

initial-focus :string

Determines if the popup should steal focus to its content when initially open. A value of none prevents the popup from grabbing focus when open.
Supported Values:
Name Type Description
"auto" string is derived from the values of the modality and autoDismiss properties
"firstFocusable" string defines that a popup should grab focus to the first focusable element within the popup's content.
"none" string prevents the popup from stealing focus when open.
"popup" string focus to the root popup container (good choice for touch platforms).
Default Value:
  • 'auto'
Names
Item Name
Property initialFocus
Property change event initialFocusChanged
Property change listener attribute (must be of type function) on-initial-focus-changed
Examples

Initialize the popup with initial-focus attribute specified:

<oj-popup initial-focus="none" ></oj-popup>

Get or set the initialFocus property, after initialization:

// getter
var initialFocus = myPopup.initialFocus;

// setter
myPopup.initialFocus = "none";

modality :string

Determines if the popup should block user input of the page behind with a blocking overlay pane.

The default modality varies by theme. Each theme can set its default by setting $popupModalityOptionDefault.

Supported Values:
Name Type Description
"modal" string The popup is modal. Interactions with other page elements are disabled. Modal popups overlay other page elements.
"modeless" string defines a modeless popup.
Default Value:
  • 'modeless'
Names
Item Name
Property modality
Property change event modalityChanged
Property change listener attribute (must be of type function) on-modality-changed
Examples

Initialize the popup to have modality modality

<oj-popup modality="modal" ></oj-popup>

Get or set the modality property, after initialization:

// getter
var modality = myPopup.modality;

// setter
myPopup.modality = "modal";

Set the default in the theme (SCSS) :

$popupModalityOptionDefault: modal !default;

position :oj.ojPopup.Position

Position property is used to establish the location the popup will appear relative to another element. oj.ojPopup.Position defines "my" alignment "at" the alignment "of" some other thing which can be "offset" by so many pixels.

The "my" and "at" properties defines aligment points relative to the popup and other element. The "my" property represents the popups alignment where the "at" property represents the other element that can be identified by "of" or defauts to the launcher when the popup opens. The values of these properties describe horizontal and vertical alignments.

Deprecated v3.0.0 jQuery UI position syntax; Use of a percent unit with "my" or "at" is not supported.
Default Value:
  • {"my":{"vertical" :"start", "horizontal": "top"}, "at": {"vertical": "start", "horizontal": "bottom"}, "collision": "flip"}
Names
Item Name
Property position
Property change event positionChanged
Property change listener attribute (must be of type function) on-position-changed
Examples

Initialize the popup with position attribute specified:

<oj-popup position.my.horizontal="left"
          position.my.vertical="top"
          position.at.horizontal="right"
          position.at.vertical="top" ></oj-popup>

Get or set the position property, after initialization:

// getter
var position = myPopup.position;

// setter
myPopup.position =
   {"my": {"horizontal": "start", "vertical": "bottom"},
    "at": {"horizontal": "end", "vertical": "top" },
    "offset": {"x": 0, "y":5}};

position.at :Object

Defines which position on the target element ("of") to align the positioned element against.
Names
Item Name
Property position.at

position.at.horizontal :string

Defines the horizontal alignment of what the popup is aligned to.
Supported Values:
Name Type Description
"center" string
"end" string evaluates to "right" in LTR mode and "left" in RTL mode.
"left" string
"right" string
"start" string evaluates to "left" in LTR mode and "right" in RTL mode.
Default Value:
  • 'start'
Names
Item Name
Property position.at.horizontal

position.at.vertical :string

Defines the vertical alignment of what the popup is aligned to.
Supported Values:
Name Type
"bottom" string
"center" string
"top" string
Default Value:
  • 'top'
Names
Item Name
Property position.at.vertical

position.collision :string

Rule for alternate alignment.
Supported Values:
Name Type Description
"fit" string shift the element away from the edge of the window.
"flip" string the element to the opposite side of the target and the collision detection is run again to see if it will fit. Whichever side allows more of the element to be visible will be used.
"flipfit" string first applies the flip logic, placing the element on whichever side allows more of the element to be visible. Then the fit logic is applied to ensure as much of the element is visible as possible.
"none" string no collision detection.
Default Value:
  • 'flip'
Names
Item Name
Property position.collision

position.my :Object

Defines which edge on the popup to align with the target ("of") element.
Names
Item Name
Property position.my

position.my.horizontal :string

Defines the horizontal alignment of the popup.
Supported Values:
Name Type Description
"center" string
"end" string evaluates to "right" in LTR mode and "left" in RTL mode.
"left" string
"right" string
"start" string evaluates to "left" in LTR mode and "right" in RTL mode.
Default Value:
  • 'start'
Names
Item Name
Property position.my.horizontal

position.my.vertical :string

Defines the vertical alignment of the popup.
Supported Values:
Name Type
"bottom" string
"center" string
"top" string
Default Value:
  • 'top'
Names
Item Name
Property position.my.vertical

position.of :string|Object|undefined

Which element to position the popup against. The default is the launcher argument passed to the open method. If the value is a string, it should be a selector or the literal string value of window. Otherwise, a point of x,y. When a point is used, the values are relative to the whole document. Page horizontal and vertical scroll offsets need to be factored into this point - see UIEvent pageX, pageY.
Names
Item Name
Property position.of
Example

Finding the point for an svg element:

var rect = svgDom.getBoundingClientRect();
var position = {of:{x:rect.left + window.pageXOffset, y:rect.top + window.pageYOffset}};

position.offset :Object

Defines a point offset in pixels from the ("my") alignment.
Names
Item Name
Property position.offset

position.offset.x :number

Horizontal aligment offset.
Default Value:
  • 0
Names
Item Name
Property position.offset.x

position.offset.y :number

Vertical alignment offset.
Default Value:
  • 0
Names
Item Name
Property position.offset.y

tail :string

Determines if a decoration will be displayed from the popup that points to the element the popup is aligned to. The simple value enables the tail defined by the current theme. In addtion, the oj-popup-tail-simple selector will be applied to the root dom element. This is to allow the box-shadow, z-index and other chrome styling to vary per tail decoration.
Supported Values:
Name Type Description
"none" string no decoration will be displayed from the popup pointing to the launcher.
"simple" string enables showing the tail defined by the current theme.
Default Value:
  • 'none'
Names
Item Name
Property tail
Property change event tailChanged
Property change listener attribute (must be of type function) on-tail-changed
Examples

Initialize the popup with tail attribute specified:

<oj-popup tail="simple" ></oj-popup>

Get or set the tail property, after initialization:

// getter
var tail = myPopup.tail;

// setter
myPopup.tail = "simple";

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

Events

ojAnimateEnd

Triggered when a default animation has ended, such as when the component is being opened/closed or a child item is being added/removed. This event is not triggered if the application has called preventDefault on the animateStart event.
Properties:

All of the event payloads listed below can be found under event.detail.

Name Type Argument Description
element Element <not nullable>
target of animation
action "open" | "close" The action that is ending the animation. The number of actions can vary from component to component. Suggested values are:
  • "open" - when a popup component is opened
  • "close" - when a popup component is closed
Examples

Bind an event listener to the onOjAnimateEnd property to listen for the "close" ending animation:

myPopup.onOjAnimateEnd = function( event )
  {
    // verify that the component firing the event is a component of interest and action
     is close
    if (event.detail.action == "close") {}
  };

The default open and close animations are controlled via the theme (SCSS) :

$popupOpenAnimation: (effect: "zoomIn", fade: true)  !default;
$popupCloseAnimation: (effect: "zoomOut", fade: true)  !default;

Specify an ojAnimateEnd listener via the DOM attribute:

<oj-popup on-oj-animate-end='[[listener]]'></oj-popup>

Specify an ojAnimateEnd listener via the JavaScript property:

myPopup.onOjAnimateEnd = listener;

Add an ojAnimateEnd listener via the addEventListener API:

myPopup.addEventListener('ojAnimateEnd', listener);

ojAnimateStart

Triggered when a default animation is about to start, such as when the component is being opened/closed or a child item is being added/removed. The default animation can be cancelled by calling event.preventDefault.
Properties:

All of the event payloads listed below can be found under event.detail.

Name Type Argument Description
action "open" | "close" The action that is starting the animation. The number of actions can vary from component to component. Suggested values are:
  • "open" - when a popup component is opened
  • "close" - when a popup component is closed
element Element <not nullable>
target of animation
endCallback function():void <not nullable>
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

Bind an event listener to the onOjAnimateStart property to override the default "close" animation:

myPopup.onOjAnimateStart = function( event )
  {
    // verify that the component firing the event is a component of interest and action
     is close
    if (event.detail.action == "close") {
      event.preventDefault();
      oj.AnimationUtils.slideOut(event.detail.element).then(event.detail.endCallback);
  };

The default open and close animations are controlled via the theme (SCSS) :

$popupOpenAnimation: ((effect: "zoomIn"), "fadeIn")  !default;
$popupCloseAnimation: ((effect: "zoomOut", persist: "all"), "fadeOut")  !default;

Specify an ojAnimateStart listener via the DOM attribute:

<oj-popup on-oj-animate-start='[[listener]]'></oj-popup>

Specify an ojAnimateStart listener via the JavaScript property:

myPopup.onOjAnimateStart = listener;

Add an ojAnimateStart listener via the addEventListener API:

myPopup.addEventListener('ojAnimateStart', listener);

ojBeforeClose

Triggered before the popup is dismissed via the close() method. The close can be cancelled by calling event.preventDefault().
Examples

Specify an ojBeforeClose listener via the DOM attribute:

<oj-popup on-oj-before-close='[[listener]]'></oj-popup>

Specify an ojBeforeClose listener via the JavaScript property:

myPopup.onOjBeforeClose = listener;

Add an ojBeforeClose listener via the addEventListener API:

myPopup.addEventListener('ojBeforeClose', listener);

ojBeforeOpen

Triggered before the popup is launched via the open() method. The open can be cancelled by calling event.preventDefault().
Examples

Specify an ojBeforeOpen listener via the DOM attribute:

<oj-popup on-oj-before-open='[[listener]]'></oj-popup>

Specify an ojBeforeOpen listener via the JavaScript property:

myPopup.onOjBeforeOpen = listener;

Add an ojBeforeOpen listener via the addEventListener API:

myPopup.addEventListener('ojBeforeOpen', listener);

ojClose

Triggered after the popup is dismissed via the close() method.
Examples

Specify an ojClose listener via the DOM attribute:

<oj-popup on-oj-close='[[listener]]'></oj-popup>

Specify an ojClose listener via the JavaScript property:

myPopup.onOjClose = listener;

Add an ojClose listener via the addEventListener API:

myPopup.addEventListener('ojClose', listener);

ojFocus

Triggered after focus has been transfered to the popup. This will occur after the open() method is called, depending on the value of the initialFocus property. It's also triggered when using the F6 key to toggle focus from the associated launcher element to the content of the popup.
Examples

Specify an ojFocus listener via the DOM attribute:

<oj-popup on-oj-focus='[[listener]]'></oj-popup>

Specify an ojFocus listener via the JavaScript property:

myPopup.onOjFocus = listener;

Add an ojFocus listener via the addEventListener API:

myPopup.addEventListener('ojFocus', listener);

ojOpen

Triggered after the popup is launched via the open() method.
Examples

Specify an ojOpen listener via the DOM attribute:

<oj-popup on-oj-open='[[listener]]'></oj-popup>

Specify an ojOpen listener via the JavaScript property:

myPopup.onOjOpen = listener;

Add an ojOpen listener via the addEventListener API:

myPopup.addEventListener('ojOpen', listener);

Methods

close() → {void}

Closes the popup. This method does not accept any arguments.
Fires:
  • oj.ojPopup#event:ojBeforeClose
  • oj.ojPopup#event:ojAnimationStart
  • oj.ojPopup#event:ojAnimationEnd
  • oj.ojPopup#event:ojClose
Returns:
Type
void
Example

Invoke the close method:

myPopup.close();

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');

isOpen() → {boolean}

Returns the state of whether the popup is currently open. This method does not accept any arguments.

The "open" state reflects the period of time the popup is visible, including open and close animations.
Returns:
true if the popup is open.
Type
boolean
Example

Invoke the isOpen method:

var isOpen = myPopup.isOpen();

open(launcher, position) → {void}

Opens the popup. This method accepts two arguments. The first argument "launcher" is required but the second "position" is optional.
Parameters:
Name Type Argument Description
launcher string | Element <not nullable>
selector or dom element that is associated with the popup. Defines the context of how the popup is used. The argument is required.
position oj.ojPopup.Position <optional>
oj.ojPopup.Position an element relative to another
Fires:
  • oj.ojPopup#event:ojBeforeOpen
  • oj.ojPopup#event:ojAnimationStart
  • oj.ojPopup#event:ojAnimationEnd
  • oj.ojPopup#event:ojOpen
Returns:
Type
void
Example

Invoke the open method:

var open = myPopup.open("#launcher");

refresh() → {void}

Causes the popup to reevaluate its position. Call this function after the content of the popup has dynamically changed while the popup is open.

This method does not accept any arguments.

Returns:
Type
void
Example

Invoke the refresh method:

myPopup.refresh();

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");

Type Definitions

Position

Properties:
Name Type Argument Description
my oj.ojPopup.PositionAlign <optional>
Defines which edge on the popup to align with the target ("of") element.
at oj.ojPopup.PositionAlign <optional>
Defines which position on the target element ("of") to align the positioned element against.
offset oj.ojPopup.PositionPoint <optional>
Defines a point offset in pixels from the ("my") alignment.
of string | oj.ojPopup.PositionPoint <optional>
Which element to position the popup against. The default is the launcher argument passed to the open method.

If the value is a string, it should be a selector or the literal string value of window. Otherwise, a point of x,y. When a point is used, the values are relative to the whole document. Page horizontal and vertical scroll offsets need to be factored into this point - see UIEvent pageX, pageY.

collision "flip" | "fit" | "flipfit" | "none" <optional>
Rule for alternate alignment.

  • "flip" the element to the opposite side of the target and the collision detection is run again to see if it will fit. Whichever side allows more of the element to be visible will be used.
  • "fit" shift the element away from the edge of the window.
  • "flipfit" first applies the flip logic, placing the element on whichever side allows more of the element to be visible. Then the fit logic is applied to ensure as much of the element is visible as possible.
  • "none" no collision detection.

PositionAlign

Properties:
Name Type Argument Description
vertical "top" | "bottom" | "center" <optional>
Vertical alignment.
horizontal "start" | "end" | "left" | "center" | "bottom" <optional>
Horizontal alignment.

  • "start" evaluates to "left" in LTR mode and "right" in RTL mode.
  • "end" evaluates to "right" in LTR mode and "left" in RTL mode.

PositionPoint

Properties:
Name Type Argument Description
x number <optional>
Horizontal aligment offset.
y number <optional>
Vertical alignment offset.