The Custom List View AddTextItem is a very useful method as the panel/label is resized automatically to fit the text but how do you read read/get the text stored at an index?
B4X:
Dim myText="ABCDEFG" As String
For line=0 To 30
xCLV1.AddTextItem(myText,"")
Next
Private Sub xCLV1_ItemClick (Index As Int, Value As Object)
Log("Index: "&Index&" Value: "&Value)
End Sub
A simple hack solution is to add the same text as the item value:
B4X:
For line=0 To 30
xCLV1.AddTextItem(myText,myText)
Next
But how can the original text at the xCLV index be read/get directly from the panel/label?
Is there a click event for the xCLV text item label?
Your simple hack works but it is better to use the line integer as the value.
The CustomListView has a panel for each item and on that panel it has a label (view number 0).
The text from that label is the item text.
B4X:
For line=0 To 30
xCLV1.AddTextItem(myText,line)
Next
Private Sub xCLV1_ItemClick (Index As Int, Value As Object)
Log("Index: "&Index&" Value: "&Value)
Log(xCLV1.GetPanel(Index).GetView(0).Text)
End Sub
Your simple hack works but it is better to use the line integer as the value.
The CustomListView has a panel for each item and on that panel it has a label (view number 0).
The text from that label is the item text.
B4X:
For line=0 To 30
xCLV1.AddTextItem(myText,line)
Next
Private Sub xCLV1_ItemClick (Index As Int, Value As Object)
Log("Index: "&Index&" Value: "&Value)
Log(xCLV1.GetPanel(Index).GetView(0).Text)
End Sub