Hi everyone, is it possibile to update the value of an item of a custom list view?
because i do not see any method for this, the only way i figured out is to:
save the view using .GetPanel
save the value using .GetValue
update the value
replace the item using .ReplaceAt and using the new value with the view (or RemoveAt and InsertAt)
but i get this errore if a try to do it, on the ReplaceAt/InsertAt
B4X:
java.lang.IllegalStateException: The specified child already has a parent. You must call removeView() on the child's parent first.
Here it is. If it is of no help, please post some code Mike. Don't be stingy with posting code:
B4X:
Sub CLV1_ItemClick (Index As Int, Value As Object) 'replace a text in a given item panel with another
Dim p As B4XView = clv1.GetPanel(Index)
Dim selColor As Int = xui.Color_ARGB(255,144,238,144)
p.Color = selColor
Dim x As String ="myxclv" & Index
p.GetView(0).text = x '1st label in item panel at given index i
p.RemoveViewFromParent
clv1.ReplaceAt(Index,p, p.Height,x)
End Sub
Here it is. If it is of no help, please post some code Mike. Don't be stingy with posting code:
B4X:
Sub CLV1_ItemClick (Index As Int, Value As Object) 'replace a text in a given item panel with another
Dim p As B4XView = clv1.GetPanel(Index)
Dim selColor As Int = xui.Color_ARGB(255,144,238,144)
p.Color = selColor
Dim x As String ="myxclv" & Index
p.GetView(0).text = x '1st label in item panel at given index i
p.RemoveViewFromParent
clv1.ReplaceAt(Index,p, p.Height,x)
End Sub
Here it is. If it is of no help, please post some code Mike. Don't be stingy with posting code:
B4X:
Sub CLV1_ItemClick (Index As Int, Value As Object) 'replace a text in a given item panel with another
Dim p As B4XView = clv1.GetPanel(Index)
Dim selColor As Int = xui.Color_ARGB(255,144,238,144)
p.Color = selColor
Dim x As String ="myxclv" & Index
p.GetView(0).text = x '1st label in item panel at given index i
p.RemoveViewFromParent
clv1.ReplaceAt(Index,p, p.Height,x)
End Sub