Skip to content

Alert Properties

The properties of the Alert widget are:


accessibilityConfig Property


Enables you to control accessibility behavior and alternative text for the widget.

For more information on using accessibility features in your app, see the Accessibility appendix in the VoltMX IrisUser Guide.

Syntax


accessibilityConfig

Type

Object

Read/Write

Read + Write

Remarks

  • The accessibilityConfig property is enabled for all the widgets which are supported under the Flex Layout.

Note: From VoltMX Iris V9 SP2 GA version, you can provide i18n keys as values to all the attributes used inside the accessibilityConfig property. Values provided in the i18n keys take precedence over values provided in a11yLabel, a11yValue, and a11yHint fields.

The accessibilityConfig property is a JavaScript object which can contain the following key-value pairs.

Key Type Description ARIA Equivalent
a11yIndex Integer with no floating or decimal number. This is an optional parameter. Specifies the order in which the widgets are focused on a screen. For all widgets, this parameter maps to the aria-index, index, or taborder properties.
a11yLabel String This is an optional parameter. Specifies alternate text to identify the widget. Generally the label should be the text that is displayed on the screen. For all widgets, this parameter maps to the aria-labelledby property of ARIA in HTML. > Note: For the Image widget, this parameter maps to the alt attribute of ARIA in HTML.
a11yValue String This is an optional parameter. Specifies the descriptive text that explains the action associated with the widget. On the Android platform, the text specified for a11yValue is prefixed to the a11yHint. This parameter is similar to the a11yLabel parameter. If the a11yValue is defined, the value of a11yValue is appended to the value of a11yLabel. These values are separated by a space.
a11yHint String This is an optional parameter. Specifies the descriptive text that explains the action associated with the widget. On the Android platform, the text specified for a11yValue is prefixed to the a11yHint. For all widgets, this parameter maps to the aria-describedby property of ARIA in HTML.
a11yHidden Boolean This is an optional parameter. Specifies if the widget should be ignored by assistive technology. The default option is set to false. This option is supported on iOS 5.0 and above, Android 4.1 and above, and SPA For all widgets, this parameter maps to the aria-hidden property of ARIA in HTML.
a11yARIA Object This is an optional parameter. For each widget, the key and value provided in this object are added as the attribute and value of the HTML tags respectively. Any values provided for attributes such as aria-labelledby and aria-describedby using this attribute, takes precedence over values given in a11yLabel and a11yHint fields. When a widget is provided with the following key value pair or attribute using the a11yARIA object, the tabIndex of the widget is automatically appended as zero.{"role": "main"}``aria-label This parameter is only available on the Desktop Web platform.

Android limitations

  • If the results of the concatenation of a11y fields result in an empty string, then accessibilityConfig is ignored and the text that is on widget is read out.
  • The soft keypad does not gain accessibility focus during the right/left swipe gesture when the keypad appears.

SPA/Desktop Web limitations

  • When accessibilityConfig property is configured for any widget, the tabIndex attribute is added automatically to the accessibilityConfig property.
  • The behavior of accessibility depends on the Web browser, Web browser version, Voice Over Assistant, and Voice Over Assistant version.
  • Currently SPA/Desktop web applications support only a few ARIA tags. To achieve more accessibility features, use the attribute a11yARIA. The corresponding tags will be added to the DOM as per these configurations.

Example 1

This example uses the button widget, but the principle remains the same for all widgets that have an accessibilityConfig property.


//This is a generic property that is applicable for various widgets.
//Here, we have shown how to use the accessibilityConfig Property for button widget.
/*You need to make a corresponding use of the accessibilityConfig property for other applicable widgets.*/

Form1.myButton.accessibilityConfig = {
    "a11yLabel": "Label",
    "a11yValue": "Value",
    "a11yHint": "Hint"    
};

Example 2

This example uses the button widget to implement internationalization in accessibilityConfig property, but the principle remains the same for all widgets.


/*Sample code to implement internationalization in accessibilityConfig property in Native platform.*/

Form1.myButton.accessibilityConfig = {
    "a11yLabel": voltmx.i18n.getLocalizedString("key1")     
};  
/*Sample code to implement internationalization in accessibilityConfig property in Desktop Web platform.*/

Form1.myButton.accessibilityConfig = {
    "a11yLabel": "voltmx.i18n.getLocalizedString(\"key3\")"
};

Platform Availability

  • Available in the IDE
  • iOS, Android, SPA, and Desktop Web

alertIcon Property


Specifies the Icon to be displayed to visually indicate the type of alert.

Syntax


alertIcon

Type

String

Read/Write

No

Remarks

In Android platform, the alert icon can be either a string specifying a local resource, or an image object created using the API: voltmx.image.

In iOS platform, you can provide the alert icon only as a string. iOS platform does not support the use of the image object.

Examples

Using a local resource for the alert icon:


//Creating the alert with the alertIcon:"icon.png"
var alertBasic = {
    message: "Sample Alert",
    alertIcon: "icon.png"
};
//The icon.png should be available in resources folder.
var alertPSP = {};

var alert = voltmx.ui.Alert(alertBasic, alertPSP);

Using an image object:


//Creating the alert with an image object
imgObjRef = voltmx.image.createImage("local.png");
pspConfig = {};
var alert = voltmx.ui.Alert({
    "message": "Alert text",
    "alertType": constants.ALERT_TYPE_INFO,
    "alertTitle": "Alert Title",
    "yesLabel": "Yes",
    "noLabel": "",
    "alertIcon": imgObjRef,
    "alertHandler": null
}, pspConfig);

Platform Availability

  • Available in the IDE
  • iOS (does not support the image object)
  • Android
  • Windows

alertTitle Property


Specifies the Title of the alert.

Syntax


alertTitle

Type

String

Accessible from Code

No

Example


//Creating the alert with the alertTitle:"Confirmation"
var alertBasic = {
    message: "Sample Alert",
    alertTitle: "Confirmation"
};

var alertPSP = {};

var alert = voltmx.ui.Alert(alertBasic, alertPSP);

Accessible from IDE

Yes

Platform Availability

Available on all platforms


alertType Property


Specifies the Type of the alert window to be displayed. You can select one of the following:

  • Confirmation - This type is used when you want the user to verify or accept something. For example, In this type, the user has to click either "OK" or "Cancel" buttons to proceed or exit.
  • error - This type is used to display when user enters incorrect value. For example, username or password in a login screen.
  • info (Default)- This type is used to display some information to the user.

Use the below constants to display alert type using constructor:

  • ALERT_TYPE_CONFIRMATION
  • ALERT_TYPE_ERROR
  • ALERT_TYPE_INFO (Default)

Syntax


alertType

Type

Number

Accessible from Code

No

Example


//Creating the alert with the alertType:constants.ALERT_TYPE_CONFIRMATION
var alertBasic = {
    message: "Sample Alert",
    alertType: constants.ALERT_TYPE_CONFIRMATION
};

var alertPSP = {};

var alert = voltmx.ui.Alert(alertBasic, alertPSP);

Accessible from IDE

Yes

Platform Availability

Available on all platforms


cursorType Property


In Desktop Web applications, when you hover the mouse over any widget, a mouse pointer appears. Using the cursorType property in Iris, you can specify the type of the mouse pointer.

Syntax


cursorType

Type

String.

You must provide valid CSS cursor value such as wait, grab, help, etc. to the cursorType property.

Read/Write

Read + Write

Remarks

To add the cursorType property using VoltMX Iris in a Desktop Web application, follow these steps.

  1. In VoltMX Iris, open the Desktop Web application. From the Project explorer, expand Responsive Web/ Desktop> Forms and select the form to which you need to make the changes.
  2. On the canvas, select the widget for which you want to specify the cursor type. For example, button.
  3. From the Properties panel, navigate to the Skin tab > H