I've been thinking about the proper solution for this. Here is my proposed solution
1. Convert ALL your data sources for ALL your selects to key value pairs
From
Dim items As List = setup.NewList
items.AddAll(Array("Abilitato", "Disabilitato"))
setup.SetData("listitems", items)
To
Dim items As List = setup.NewList
items.AddAll(Array("Abilitato", "Disabilitato"))
Dim items1 As List = vuetify.ListToDataSource("id", "text", items)
setup.SetData("listitems", items)
If for example, you know that Abalitato = 1 and Disabilitato = 0, then you would do this like this.
items.Add(CreateMap("id":0, "text":"Disabilitato"))
items.add(CreateMap("id":1, "text":"Abalitato "))
without using, Dim items1 As List = vuetify.ListToDataSource("id", "text", items)
So when a person selects Disabilitato, the returned value will be 0 and when selecting Abilitato, the returned value will be 1.
So for this list, the key is "id" and the value is "text"
2. Update your code to reflect that for ALL affected data sources, we are using key value pairs, i.e. "id" and "text"
From
abilitaMon1 = vuetify.AddSelect(Me, RowAbilitaMon1.id, "abilitaMon1", "abilitaMon1selected", "Abilita 1 cent", False, False, "", "listitems", "", "", False, "Abilita 1 cent", CreateMap(":outlined":True))
To
abilitaMon1 = vuetify.AddSelect(Me, RowAbilitaMon1.id, "abilitaMon1", "abilitaMon1selected", "Abilita 1 cent", False, False, "", "listitems", "id", "text", False, "Abilita 1 cent", CreateMap(":outlined":True))
3. To be able to quickly update all your v-models, update the v-models to use a map.
3.1 Create a map variable state by initialiating it, for example
Sub comboBoxInit
setup.SetData("record", setup.NewMap)
3.2. Update ALL the v-models for all components . i.e. prefix them with
record. Please ensure that the vmodel is in lowercase.
From
abilitaMon1 = vuetify.AddSelect(Me, RowAbilitaMon1.id, "abilitaMon1", "abilitaMon1selected", "Abilita 1 cent", False, False, "", "listitems", "id", "text", False, "Abilita 1 cent", CreateMap(":outlined":True))
To
abilitaMon1 = vuetify.AddSelect(Me, RowAbilitaMon1.id, "abilitaMon1", "record.abilitamon1selected", "Abilita 1 cent", False, False, "", "listitems", "id", "text", False, "Abilita 1 cent", CreateMap(":outlined":True))
4. Setting the states
Remember, to set and get the state one uses .SetData and .GetData, so to update the state in this case.
Dim rec as Map = setup.NewMap
rec.put("abilitamon1selected", "Abilitato")
rec.put("abilitaMon2selected", "Disabilitato")
If you used the 0 and 1 then you would write
rec.put("abilitamon1selected", 1)
rec.put("abilitaMon2selected", 0)
then, by setting the state once using the map object
setup.setdata("record", rec)
If you get the record from a db for example, you would use..
Dim rec As Map = dbSQL.Result.Get(0)
All the values that are affected for the selects and text fields will be updated as soon as .SetData("record", ??? is executed.
All the best.