I have populate a Tableview using a Wrapper, where some controls are 'Label' and others are 'TextField'
When I click on a cell containing a Label the RowSelected property is changed, the backcolor of the row is changed and all the other tableview properties are well changed.
When I click on a Cell containing a Textfield this one get the focus but there aren't any effects on the Tableview. I'd like that tableview is affected as if I click on a label.
Have you got any idea how can I fix this issue? I Attach an example.
Many Thanks.
B4X:
Private Sub DrawTablaView
'Columns Tableview
Dim columns() As String=Array As String("Code","Description")
Dim columnsSize As Map
columnsSize.Initialize
columnsSize.Put(0,100) 'Code
columnsSize.Put(1,tv.PrefWidth-100) 'Description
'Draw Columns
tv.Items.Clear
tv.SetColumns(columns)
For Each col In columnsSize.Keys
tv.SetColumnSortable(col,False)
tv.SetColumnWidth(col,columnsSize.Get(col))
Next
For Each c As Component In mList
Dim row(columns.Length) As Object
RowBuilder(row,c)
tv.Items.Add(row)
Next
End Sub
Private Sub RowBuilder(row() As Object, c As Component)
For i=0 To row.Length-1
Select Case i
Case 0 'Code
Dim lb As Label
lb.Initialize("lbCode")
lb.Text=NumberFormat(c.Code,1,0)
lb.Tag=c
row(i)=WrapControl(lb)
Case 1
Dim tf As TextField
tf.Initialize("tfDescription")
tf.Text=c.Description
row(i)=WrapControl(tf)
End Select
Next
End Sub
Sub WrapControl(control As Object) As Pane
Dim pn As AnchorPane
pn.Initialize("")
pn.AddNode(control, 0, 0, -1, -1)
pn.FillHorizontally(control, 0, 0)
pn.FillVertically(control,0,0)
Return pn
End Sub
When I click on a Cell containing a Textfield this one get the focus but there aren't any effects on the Tableview. I'd like that tableview is affected as if I click on a label.
Have you got any idea how can I fix this issue? I Attach an example.
Many Thanks.