Skip to main content

 

 

 

 
Language:
 
Applies only to Mobile Apps and Reactive Web Apps
Service Studio version:
 
 
OutSystems

Range Slider

Template:OutSystems/Documentation_KB/ContentCollaboration
  • Edit
    Collaborate with us
    Edit this page on GitHub
  • You can use the Range Slider UI Pattern to allow users select a single value between two range values. This pattern enables the adjustment of content within a predetermined range. Moving the slider along the track, increases or decreases the value.

    How to use the Range Slider UI Pattern

    In this example, we create a Range Slider that allows the user select the number of months it will take them to pay back a loan.

    1. In Service Studio, in the Toolbox, search for Range Slider.

      The Range Slider widget is displayed.

      If the UI widget does not display, it may be because you used a ready-made app, which deletes unused widgets from the module. To make additional widgets available in your app:

      a. Go to Module > Manage dependencies.

      b. Search for and select the relevant Producer, for example OutSystemsUI. Ensure Show All is selected.

      c. On the Public elements for the selected Producer displayed on the right, ensure Show All is selected.

      d. Search for and select the element you want to add, and click Apply.

      e. In Service Studio, in the Toolbox, search for the widget again.

    2. From the Toolbox, drag the Range Slider widget into the Main Content area of your application's screen.

    3. On the Properties tab, enter the minimum, maximum, and initial values. In this example, we add static values.

    4. To create an OnChange event, on the Properties tab, from the Handler drop-down, select New Client Action.

      By default, the Value input parameter is created.

    5. From the Toolbox, drag the Container widget into the Main Content area of your application's screen, and add your content to the Container placeholder. In this example we add some text and an expression.

    6. To create a variable for the expression, right-click your screen name, select Add Local Variable, and on the Properties tab, enter a name and data type (in this example, we use Decimal).

    7. To bind the new variable to the expression, double-click the expression widget, and in the Expression Value editor, select the variable you just have created, and click Done.

    8. So that the Value parameter reads the range slider selection, double-click your client action, and from the Toolbox, add the Assign action to the client action.

    9. Set the Assign Variable to the local variable you created, and the Assign Value to the automatically generated input parameter (Value).

    10. From the Properties tab, you can change the Range Slider's look and feel by setting the (optional) properties.

    After following these steps and publishing the module, you can test the pattern in your app.

    Result

    Properties

    Property Description
    MinValue (Decimal): Mandatory Slider's minimum value.

    Examples

    • 1 - The slider's minimum value is 1.
    MaxValue (Decimal): Mandatory Slider's maximum value.

    Examples

    • 100 - The slider's maximum value is 100.
    InitialValue (Decimal): Mandatory Value selected by default when the page is rendered. Must be between min and max values.

    Examples

    • 10 - Slider's default value when the page is rendered is 10.
    Step (Decimal): Optional The slider moves in increments of steps.

    Examples

    • Blank - The slider increases in steps of 1. This is the default value.
    • 10 - The slider increases in steps of 10.
    ShowPips (Boolean): Optional If True, pips are shown below the slider. This is the default value. If False, no pips are shown.
    PipsStep (Integer): Optional Range interval after which a Pip is drawn (when ShowPips is enabled). If not specified, the component tries to guess what step fits your data.
    ChangeEventDuringSlide (Boolean): Optional If True, a change event is triggered while the slider is being dragged. This is the default value. If False, the change events are only triggered when the user releases the slider. Tip: If you're refreshing a query based on the value of the slider, you probably want to set this to False.
    IsDisabled (Boolean): Optional If True, the slider is disabled. If False, the slider is enabled. This is the default value.
    IsVertical (Boolean): Optional If True, the slider orientation is vertical. If False, the slider orientation is horizontal.
    VerticalHeight (Integer): Optional If IsVertical is True, use this property to set the height (in px) of the slider.

    Examples

    • Blank - The slider is 100px high. This is the default value.
    • 250 - The slider is 250px high.
    AdvancedFormat (Text): Optional Allow for more options beyond what's provided through the input parameters. For more information, visit: https://kimmobrunfeldt.github.io/progressbar.js/. Example: { easing: 'bounce' }
    • Was this article helpful?