Selectbar component bound to boolean

Hi ,
I'm trying to exchange a checkbox with a selectbar component ( within a non templateform).
It seems to work with updating the values from the form to the database , but it fails when using a edit dialog to initialize the value :


if value in database was False it should select and initialize the option with the value "false" or "0", the selected value should look like the image above. But in my case none of the options are selected.

So the question is why the selectbar component is not initilizing with the data from the database.

Hi @mcanavar,

How are the Selectbar options configured? The following configuration seems to work for me:

I am using ${true} instead of just true because the latter sets the value of the option to the string "true" instead of the boolean value. The first is rendered as [value]="true" and the second as value="true" which to Angular is not the same.

Hi @korchev,

I did it without the ${true},

I'll try .

Off topic: how to get the selected index of the dropdown component ?

The change event only provides the value. You will have to find its index from the Data property of the dropdown.

I'm trying to preset / save selected value in session or localdata.
It works but the change event is not fired ..
I've managed to call the change event of the dropdown , but it needs the index to work.

PS: the ${true} and ${false} did the trick , thank you .