I want to use a range slider in a screen to answer a question. So when the submit button is hit, the value needs to be stored.

I have made a client action which is triggered by the onChange event of the slider. The slider seems to work fine, but when I add the value of the event as an inputvariable of the action and assign it to a localvariable of the screen, the slider keeps jumping back to the default value. I have tried debugging the action and found that the action is triggered 3-5 times when the slider is released. The first call of the action the input value has the correct new value of the slider, but the other calls, the input value has the default value. Hereby it jumps back to the default value.

Why are you storing the selected value in a local variable and for what purpose? If you are trying to use it as a starting value for the slider you get the multiple OnChange events you describe.

I stored it in a local variable to save this value and multiple others in another action to the server. So therefore I thought that I had to store it first in a local variable, because I cannot save it in the server directly because I do not have the other values yet. I retrieve those values after clicking on the save button.


So what I do is I have a screen called question. And in this screen I added a question with a rangeslider and a save button. For the rangeslider, the RangeSliderOnChange2 is created and have the inputvariable Value from the event rangeslider. I want to use this value in the SaveOnClick action.

I hope you understand what I did and what I need to do to store this value in the SaveOnClick action.

Solution

Hi Nina,

I created the following Demo that seems to do what you want. It uses the newest version of OutSystems UI at this time.

https://vkoning.outsystemscloud.com/RangeSliderDemo/Demo

edit: To clarify it a bit more. I also store the value in a local variable and when I press the save button this value is passed on to a new client action that then provides the feedback message.

Kind regards,

Vincent

Solution