Wish xCustomListView - SetValue method

Erel

B4X founder
Staff member
Licensed User
Longtime User
1. You can use GetRawListItem to access all the item attributes and update the value. If you don't see this method then add it:
B4X:
Public Sub GetRawListItem(Index As Int) As CLVItem
   Return items.Get(Index)
End Sub
(it will be included in the next version of xCLV).

2. Better option is to use a custom type for the value and update it:
B4X:
Dim Value As MyValue = CLV.GetValue(index)
Value.Score = 200
 

LucaMs

Expert
Licensed User
Longtime User
1. You can use GetRawListItem to access all the item attributes and update the value. If you don't see this method then add it:
I prefer not to say what I tried.
I do not say that in the past days I have seen that the values are stored in the Items List and that I tried to remove an element and insert the new value in the same place (index) because I did not remember the simple ListX.Set command. I do not write it :p
Then it's very easy to add the SetValue to xCLV:
B4X:
Public Sub SetValue(Index As Int, Value As Object)
    items.Set(Index, Value)
End Sub
[I don't like too much the contextual help:
upload_2018-5-6_12-33-34.png

I would change the word "item" to "value"
]

2. Better option is to use a custom type for the value and update it:
Very good solution (although adding the new method is better, of course).
 
Last edited:
Top