Deon
Posts: 0
Joined: Sun Jun 30, 2013 6:00 am

Select Component not clearing its values and labels

Hi

I update the values/labels for a Select Component from a database.

Once I have populated the Select Component with values, it will not clear the values when I request data again and the dataset is empty. The Select Component should not display anything because there was nothing from the dataset, however it is still displaying the previous datasets values.

How can I clear the Select Component?

Thanks

Serhii Kulibaba
Posts: 150
Joined: Tue Aug 27, 2013 1:47 pm

Select Component not clearing its values and labels

Hello Deon,

Does you select component have the empty value? If not - it is impossible to reset it.

So the general rule is: it is possible to select a value, if it is a value of the option, see the example here: https://jsfiddle.net/spencer4of6/j9o6...

Deon
Posts: 0
Joined: Sun Jun 30, 2013 6:00 am

Select Component not clearing its values and labels

Hi
I dont see the point of the example.
I am pulling data from a collection into the Select Component, however if no data is returned from the collection the Select Component displays the previous requests data.

So what I am saying if the data result set is nothing, the select component should not display anything.

Serhii Kulibaba
Posts: 150
Joined: Tue Aug 27, 2013 1:47 pm

Select Component not clearing its values and labels

In that case you have to add a new option to the select component with the empty value and the text like 'please select the value'. You can do it with the same mapping. Just save the service response to the storage variable and add there this empty value. This is only one way to do it

Return to “Issues”