B4XListTemplate does not seem suitable for a list like either of these 2 types of lists or don't I know what I am talking about:Another one to consider is B4XDialog + ListTemplate.
SettingsList.Add($"EvenRowColor,xui.Color_Cyan"$)
SettingsList.Add($"OddRowColor,xui.Color_Yellow"$)
SettingsList.Add(Array("OddRowColor", xui.Color_Yellow))
SettingsList.Add(Array("GridColor", xui.Color_Red)
options.Options = SettingsList
Yes. It is a good choice but I tried it in my situation and it didn't work like CLVSelection or XSelection of B4Xtable, unless I am overlooking something. So I am using either of the latter two.The question in the first post is about lists that allow multiselection. B4XListTemplate supports multiselection and is my preferred method.
This can be done quite easily with an additional Map.
SettingsList.Add(Array("OddRowColor", xui.Color_Yellow)) 'SettingsList is the full list
SettingsList.Add(Array("GridColor", xui.Color_Red))
SettingsList.Add(Array("pnlHeader.Color", xui.Color_Cyan))
SettingsList.Add(Array("HeaderColor", xui.Color_Green))
SettingsList.Add(Array("HeadersHeight" , 70dip))
MySelectionsList.Initialize 'declared as list of selected items
options.Options = SettingsList 'options is declared as B4XListTemplate
options.AllowMultiSelection = True 'allows multi selection
Wait For (Dialog.ShowTemplate(options, "OK", "", "CANCEL")) Complete (Result As Int)
If Result = xui.DialogResponse_Positive Then
MySelectionsList = options.SelectedItems
End If
Private Sub CreateSettingsMapFromSelections As Map
Dim m As Map
m.Initialize
For Each s() As Object In MySelectionsList
m.Put(s(0),s(1))
Next
Return m
End Sub
This is what I meant.Edited few hours later: I created a map whose keys are the B4XListTemplate items and their values are the corresponding B4Xtable settings. For instance the key is: OddRowColor and the value would be xui.Color_Yellow. Then I used the individual items from the list of all selected items.of the B4XListTemplate along with their corresponding values to create another map that I used for the settings of B4XTable. See newer screenshot not dealing with arrays. It seems to work. If this is not kosher, please advise: