How to clear the selection on UIViewFieldSelectField

#1

Is there a command to reset the selection on a UIViewFieldSelectField? I am searching for something which works like the following:

var elem = env.findComponent('ApplicationID.Dashboard.DashboardSibiloCode');
elem.setSelectedOpt(elem.placeholder)

Unfortunately, the above commands does not work as I wish.

Essentially, I want to manually reset the selection to the value on the placeholder.

Thanks!

0 Likes

#2

c3ShowType(UIViewFieldSelectField) shows:

setSelectedOpt(): any member

Set value to the pre-selected value defined by selectedOpt option.

I believe you need to set the selectedOpt field first, then run this method with no arguments.

0 Likes

#3

Yes, I was just trying these actions! The following did the trick:

MySelector.selectedOpt = MySelector.placeholder;
MySelector.setSelectedOpt();
0 Likes