Skip to content

Slider Properties

The properties for the Slider widget are as follows:


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

anchorPoint Property


Specifies the anchor point of the widget bounds rectangle using the widget's coordinate space.

Syntax


anchorPoint

Type

JSObject

Read/Write

Read + Write

Remarks

The value for this property is a JavaScript dictionary object with the keys "x" and "y". The values for the "x" and "y" keys are floating-point numbers ranging from 0 to 1. All geometric manipulations to the widget occur about the specified point. For example, applying a rotation transform to a widget with the default anchor point causes the widget to rotate around its center.

The default value for this property is center ( {"x":0.5, "y":0.5} ), that represents the center of the widgets bounds rectangle. The behavior is undefined if the values are outside the range zero (0) to one (1).

Example

Form1.widget1.anchorPoint = {
    "x": 0.5,
    "y": 0.5
};

Platform Availability

  • iOS, Android, Windows, and SPA

bottom Property


This property determines the bottom edge of the widget and is measured from the bottom bounds of the parent container.

The bottom property determines the position of the bottom edge of the widget’s bounding box. The value may be set using DP (Device Independent Pixels), Percentage, or Pixels. In freeform layout, the distance is measured from the bottom edge of the parent container. In flow-vertical layout, the value is ignored. In flow-horizontal layout, the value is ignored.

The bottom property is used only if the Height property is not provided.

Syntax


bottom

Type

String

Read/Write

Read + Write

Remarks

The property determines the bottom edge of the widget and is measured from the bottom bounds of the parent container.

If the layout Type is set as voltmx.flex.FLOW_VERTICAL, the bottom property is measured from the top edge of bottom sibling widget. The vertical space between two widgets is measured from bottom of the top sibling widget and the top of the bottom sibling widget.

Example

//Sample code to set the bottom property for widgets by using DP, Percentage and Pixels.
frmHome.widgetID.bottom = "50dp";

frmHome.widgetID.bottom = "10%";

frmHome.widgetID.bottom = "10px";

Platform Availability

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

centerX Property


This property determines the center of a widget measured from the left bounds of the parent container.

The centerX property determines the horizontal center of the widget’s bounding box. The value may be set using DP (Device Independent Pixels), Percentage, or Pixels. In freeform layout, the distance is measured from the left edge of the parent container. In flow-vertical layout, the distance is measured from the left edge of the parent container. In flow-horizontal layout, the distance is measured from the right edge of the previous sibling widget in the hierarchy.

Syntax


centerX

Type

String

Read/Write

Read + Write

Remarks

If the layoutType is set as voltmx.flex.FLOW_HORIZONTAL, the centerX property is measured from right edge of the left sibling widget.

Example

//Sample code to set the centerX property for widgets by using DP, Percentage and Pixels.
frmHome.widgetID.centerX = "50dp";

frmHome.widgetID.centerX = "10%";

frmHome.widgetID.centerX = "10px";

Platform Availability

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

centerY Property


This property determines the center of a widget measured from the top bounds of the parent container.

The centerY property determines the vertical center of the widget’s bounding box. The value may be set using DP (Device Independent Pixels), Percentage, or Pixels. In freeform layout, the distance is measured from the top edge of the parent container. In flow-horizontal layout, the distance is measured from the top edge of the parent container. In flow-vertical layout, the distance is measured from the bottom edge of the previous sibling widget in the hierarchy.

Syntax


centerY

Type

String

Read/Write

Read + Write

Remarks

If the layoutType is set as voltmx.flex.FLOW_VERTICAL, the centerY property is measured from bottom edge of the top sibling widget.

Example

//Sample code to set the centerY property for widgets by using DP, Percentage and Pixels.
frmHome.widgetID.centerY = "50dp";

frmHome.widgetID.centerY = "10%";

frmHome.widgetID.centerY = "10px";

Platform Availability

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

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 Volt MX Iris in a Desktop Web application, follow these steps.

  1. In Volt MX 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 > Hover Skin tab.
    You will find that the details of the hover skin is not enabled here.
  4. Check the Enable option to add a hover skin to your widget.
    The details and configurations of the hover skin is enabled.
  5. Under the General section, for the Platform option, click the ellipsis icon.
    The Fork Skin window appears.
  6. In the Fork Skin window, for Desktop, check under HTML5 SPA.
  7. Click Ok. You have successfully forked your hover skin for Desktop Web application.
    You can see that the Cursor Type property has been added under the General section.
  8. Select a value from the drop-down list to set the Cursor Type for the widget.

Example

 //This is a generic property and is applicable for many widgets.  

/*The example provided is for the Button widget. Make the required changes in the example while using other widgets.*/

frmButton.myButton.cursorType = "wait";

Platform Availability

  • Available in IDE
  • Desktop Web

enable Property


The enable property is used to control the actionability of the widgets. In a scenario where you want to display a widget but not invoke any action on the widget, configure the enable property to false to achieve it.

This is a constructor level property and applicable for all widgets in Volt MX Iris.

Syntax


enable

Type

Boolean

Read/Write

Read + Write

Remarks

The default value of this property is true.

When enable property is configured to true, the action associated with a widget can be invoked by the user in the application.

When enable property is configured to false, the action associated with a widget cannot be invoked by the user in the application.

Example

//This is a generic property and is applicable for many widgets.  

/*The example provided is for the Button widget. Make the changes required in the example while using other widgets.*/

frmButton.myBtn.enable= true;

Platform Availability

  • Android, iOS, Windows, SPA, and Desktop web

enableCache Property


The property enables you to improve the performance of Positional Dimension Animations.

Syntax


enableCache

Type

Boolean

Read/Write

Read + Write

Remarks

The default value for this property is true.

Note: When the property is used, application consumes more memory. The usage of the property enables tradeoff between performance and visual quality of the content. Use the property cautiously.

Example

Form1.widgetID.enableCache = true;

Platform Availability

  • Available in the IDE.
  • Windows

enableThumbTintColor Property


This property enables you to configure thumbTintColor property.

Syntax


enableThumbTintColor

Type

Boolean

Example

//Sample code to set the enableThumbTintColor property of a Slider widget.

frmSlider.mySlider.enableThumbTintColor=true;

Platform Availability

  • Available in the IDE
  • iOS

focusThumbImage Property


Specifies the image to indicate that there is focus on the thumb.

Syntax


focusThumbImage

Type

String / image Object

Read/Write

Read + Write

Remarks

You can create an image Object by using voltmx.image Namespace functions.

You can select the image from the resources folder.

If you specify a focus thumb image, you must also ensure that you have specified an image for the thumb image property.

Example

Using a string to assign a local resource for focusThumbImage.

/*Sample code to set the focusThumbImage property of a Slider widget where fThumb.png is an image file in the resources folder.*/
frmSlider.mySlider.focusThumbImage="fThumb.png";

Using an image object (voltmx.image) to assign an image to focusThumbImage:

/*Sample code to set the focusThumbImage property of a Slider widget where local.png is an image file in the resources folder.*/
var imgObjRef = voltmx.image.createImage("local.png");
frmSlider.mySlider.focusThumbImage=imgObjRef;

Platform Availability

  • Available in the IDE
  • iOS, Android, and Windows

height Property


It determines the height of the widget and measured along the y-axis.

The height property determines the height of the widget’s bounding box. The value may be set using DP (Device Independent Pixels), Percentage, or Pixels. For supported widgets, the height may be derived from either the widget or container’s contents by setting the height to “preferred”.

Syntax


height

Type

Number, String, and Constant

Read/Write

Read + Write

Remarks

Following are the available measurement options:

  • %: Specifies the values in percentage relative to the parent dimensions.
  • px: Specifies the values in terms of device hardware pixels.
  • dp: Specifies the values in terms of device independent pixels.
  • default: Specifies the default value of the widget.
  • voltmx.flex.USE_PREFERED_SIZE: When this option is specified, the layout uses preferred height of the widget as height and preferred size of the widget is determined by the widget and may varies between platforms.

Example

/*Sample code to set the height property for a Slider widget by using DP, Percentage and Pixels.*/
frmSlider.mySlider.height="50dp";

frmSlider.mySlider.height="10%";

frmSlider.mySlider.height="10px";

Platform Availability

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

id Property


A unique identifier of Slider consisting of alpha numeric characters. Every Slider should have a unique id within a Form.

Syntax


id

Type

String

Read/Write

Read only

Example

//Defining the properties for Slider with the id:"slider".
var sliderBasic = {
    id: "slider",
    info: {
        key: "SLIDER"
    },
    min: 0,
    max: 100,
    step: 1,
    isVisible: true,
    leftSkin: "lKin",
    rightSkin: "rSkin",
    thumbImage: "thumb.png",
    focusThumbImage: "fThumb.png",
    selectedValue: 50
};

var sliderLayout = {
    margin: [5, 5, 5, 5],
    marginInPixel: true,
    widgetAlignment: constants.WIDGET_ALIGN_CENTER,
    containerWeight: 99
};

var sliderPSP = {};

//Creating the Slider.
var slider = new voltmx.ui.Slider(sliderBasic, sliderLayout, sliderPSP);

//Reading id of the Slider.
alert("Slider id is ::" + slider.id);

Platform Availability

  • Available in the IDE
  • Available on all platforms.

info Property


A custom JSObject with the key value pairs that a developer can use to store the context with the widget.

Syntax


info

Type

JSObject

Read/Write

Read + Write

Remarks

This will help in avoiding the globals to most part of the programming.

This is a non-Constructor property. You cannot set this property through widget constructor. But you can read and write data to it.

Info property can hold any JSObject. After assigning the JSObject to info property, the JSObject should not be modified. For example,

var inf = {
    a: "hello"
};
widget.info = inf; //works
widget.info.a = "hello world";
/*This will not update the widget info a property to Hello world.
widget.info.a will have old value as hello.*/

Example

//Sample code to set the info property for a Slider widget.
frmSlider.mySlider.info={
    key: "SLIDER"
};
//Reading info of the Slider widget.
alert("Slider widget info is ::" +frmSlider.mySlider.info);

Platform Availability

  • Available in the IDE
  • Available on all platforms.

isVisible Property


This property controls the visibility of a widget on the form.

Syntax


isVisible

Type

Boolean

Read/Write

Read + Write

Remarks

The default value for this property is true.

  • If set to false, the widget is not displayed.
  • If set to true, the widget is displayed.

Example

//Sample code to set the isVisible property of a Slider widget.
frmSlider.mySlider.isVisible=true;

Note: You can set the visibility of a widget dynamically from code using the setVisibility method.

Platform Availability

  • Available in the IDE
  • Available on all platforms.

left Property


This property determines the lower left corner edge of the widget and is measured from the left bounds of the parent container.

The left property determines the position of the left edge of the widget’s bounding box. The value may be set using DP (Device Independent Pixels), Percentage, or Pixels. In freeform layout, the distance is measured from the left edge of the parent container. In flow-vertical layout, the distance is measured from the left edge of the parent container. In flow-horizontal layout, the distance is measured from the right edge of the previous sibling widget in the hierarchy.

Syntax


left

Type

String

Read/Write

Read + Write

Remarks

If the layoutType is set as voltmx.flex.FLOW_HORIZONTAL, the left property is measured from right edge of the left sibling widget.

Example

//Sample code to set the left property for widgets by using DP, Percentage and Pixels.
frmHome.widgetID.left = "50dp";

frmHome.widgetID.left = "10%";

frmHome.widgetID.left = "10px";

Platform Availability

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

leftSkin Property


Skin to be applied to the background of the slider on left side of the thumb image.

Syntax


leftSkin

Type

String

Read/Write

Read + Write

Remarks

Specifies the skin to be applied to the selected part of the seekbar (skin is applied to the left side of the thumb icon).

The default value for this property is None (no skin is applied).

If you want to apply a skin, select the desired skin from the available skins.

You must be aware of the following:
- On Android platform, if you specify only a Left Skin, you must ensure that you specify a skin with a rounded corner. If you do not specify a skin with a rounded corner, the appearance of the selected and progress part of the seekbar is not identical.
- On iPhone platform, only a skin with the Background Style as Image is allowed.

The following image illustrates a Slider with the skins applied:

Example

//Sample code to set the leftSkin property of a Slider widget.
frmSlider.mySlider.leftSkin="lSkin";

Platform Availability

  • Available in the IDE
  • Available on all platforms

max Property


Specifies the maximum value on the slider that you can select. It accepts a non-decimal value.

Syntax


max

Type

Number (non-decimal value)

Read/Write

Read + Write

Remarks

The maximum value is not displayed on the Slider. To display the maximum value, you must specify the maxLabel (not supported on iPhone).

The default value for this property is "100" (the default maximum value on the slider that you can select is hundred).

If you want to set a different maximum value, you can set any Number (the Number can be upto 4 bytes (positive or negative)) as the maximum value.

The maximum value must be greater than the minimum value.

Example

//Sample code to set the max property of a Slider widget.
frmSlider.mySlider.max=100;

Platform Availability

  • Available in the IDE
  • Available on all platforms.

maxHeight Property


This property specifies the maximum height of the widget and is applicable only when the height property is not specified.

The maxHeight property determines the maximum height of the widget’s bounding box. The value may be set using DP (Device Independent Pixels), Percentage, or Pixels. The maxHeight value overrides the preferred, or “autogrow” height, if the maxHeight is less than the derived content height of the widget.

Syntax


maxHeight

Type

Number

Read/Write

Read + Write

Example

//Sample code to set the maxHeight property for widgets by using DP, Percentage and Pixels.
frmHome.widgetID.maxHeight = "50dp";

frmHome.widgetID.maxHeight = "10%";

frmHome.widgetID.maxHeight = "10px";

Platform Availability

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

maxLabel Property


Specifies the text or number to be displayed for the maximum value of the slider.

Syntax


maxLabel

Type

String

Remarks

This text is displayed just below the slider on the right.

The default value for this property is null/nil (No label is displayed)

The following image illustrates a Slider with the text "Maximum Value" in the maxLabel property:

Example

//Sample code to set the maxLabel property of a Slider widget.
frmSlider.mySlider.maxLabel="100";

Platform Availability

  • Android, Windows, and SPA

maxLabelSkin Property


Specifies the skin (font color or style) for the maxLabel property of the slider.

Syntax


maxLabelSkin
</