Switch

Last update: Edit

1 Introduction

The Switch widget enables toggling a Boolean attribute.

2 Usage

To use this widget, place it in a data container that has a Boolean attribute.

The widget offers the following for configuration:

  • A Boolean attribute to toggle on user-interaction
  • An action (such as Microflow or Nanoflow) to trigger when the Switch is toggled
  • A Device style design property with two options (iOS and Android) influencing the Switch’s appearance
  • A Style design property for brand styling, influencing the Switch’s colors
  • Common properties

This widget is compatible with Atlas Core.

3 Previous Versions’ Documentation

Widgets Below v3.0.0

1 Introduction

The Switch widget enables toggling a Boolean attribute.

1.1 Features
  • Deactivate when attribute or context is read-only
  • Execute a microflow when toggled
  • Execute a nanoflow when toggled
  • Add a label to the switch
  • Display in either iOS style or android(material design)
  • Display in various bootstrap styles
1.2 Demo App

For a demo app that has been deployed with this widget, see here.

2 Usage

To use this widget, place it in the context of an object that has a Boolean attribute.

3 Developing This Marketplace Component

To contribute to the development of this widget, follow these steps:

  1. Install the following:
  2. Fork and clone the mendixlabs/boolean-slider repository. The code is in Typescript.
  3. Set up the development environment by running npm install.
  4. Create a folder named dist in the project root.
  5. Create a Mendix test project in the dist folder and rename its root folder to dist/MxTestProject, or get the test project from mendixlabs/boolean-slider. Changes to the widget code will be automatically pushed to this test project.
  6. To automatically compile, bundle, and push code changes to the running test project, run grunt.
  7. To run the project unit tests with code coverage (results can be found at dist/testresults/coverage/index.html), run: npm test.
  8. Run the unit test continuously during development via karma start.

We are actively maintaining this widget. Please report any issues or suggestions for improvement at mendixlabs/boolean-slider.

4 Read More