Hello.
I don't understand what is the problem
I adapted the code of TableExample tutorial and write this code:
As you can see, I put some messagebox to know the value of some data.
Only 2 row of 2 column for this example.
During the ajoutligne running sub, the data shown are:
First row, first column
row col clef : 0.0.1
cell.Tag : init ok, value clef 1, col 0, row 0
First row, second column
row col clef : 0.1.1
cell.Tag : init ok, value clef 1, col 1, row 0
Second row, first column
row col clef : 1.0.2
cell.Tag : init ok, value clef 2, col 0, row 1
second row, second column
row col clef : 1.1.2
cell.Tag : init ok, value clef 2, col 1, row 1
etc...
All the data seem correct (it's normal that clef is increase)
But during the Cellule_Click sub, the data are:
First row, first column
row col clef : 0.1.1
cell.Tag : init ok, value clef 1, col 1, row 0
First row, second column
row col clef : 0.1.1
cell.Tag : init ok, value clef 1, col 1, row 0
Second row, first column
row col clef : 1.1.2
cell.Tag : init ok, value clef 2, col 1, row 1
second row, second column
row col clef : 1.1.2
cell.Tag : init ok, value clef 2, col 1, row 1
As you can see, the column number is always 1, I cannot have the good column number.
Do you see where is my mistake please ?
I don't understand what is the problem
I adapted the code of TableExample tutorial and write this code:
B4X:
Sub AjoutLigne(valeur() As String, ind As Int)
If valeur.Length<>2 Then Return
Dim cell As Label
'First column
cell.Initialize("cellule")
cell.Text=valeur(0)
cell.Gravity=Gravity.LEFT
cell.TextSize=18
cell.TextColor=Colors.Black
cell.Color=Colors.White
Dim ligneColonne As coordonnee
ligneColonne.Initialize
ligneColonne.col = 0
ligneColonne.row = numeroDeLigne
ligneColonne.clef = ind
cell.Tag = ligneColonne
Msgbox("row col clef" & CRLF & ligneColonne.row & " " & ligneColonne.col & " " & ligneColonne.clef,"lignecolonne")
Msgbox(cell.Tag,"celltag")
panTable.AddView(cell, 0, 40 * numeroDeLigne, 400, 38)
'sencond column
cell.Initialize("cellule")
cell.Text=valeur(1)
cell.Gravity=Gravity.CENTER_HORIZONTAL
cell.TextSize=18
cell.TextColor=Colors.Black
cell.Color=Colors.White
ligneColonne.col = 1
ligneColonne.row = numeroDeLigne
ligneColonne.clef = ind
cell.Tag=ligneColonne
Msgbox("row col clef" & CRLF & ligneColonne.row & " " & ligneColonne.col & " " & ligneColonne.clef,"lignecolonne")
Msgbox(cell.Tag,"celltag")
panTable.AddView(cell, 400, 40 * numeroDeLigne, 80, 38)
numeroDeLigne=numeroDeLigne+1
panTable.Height=numeroDeLigne*40
End Sub
Sub Cellule_Click
Dim ligneColonne As coordonnee
ligneColonne.Initialize
Dim l As Label
l = Sender
ligneColonne=l.Tag
modifSaisie = ligneColonne.clef
Msgbox("row col clef" & CRLF & ligneColonne.row & " " & ligneColonne.col & " " & ligneColonne.clef,"lignecolonne")
Msgbox(l.Tag,"ltag")
End Sub
As you can see, I put some messagebox to know the value of some data.
Only 2 row of 2 column for this example.
During the ajoutligne running sub, the data shown are:
First row, first column
row col clef : 0.0.1
cell.Tag : init ok, value clef 1, col 0, row 0
First row, second column
row col clef : 0.1.1
cell.Tag : init ok, value clef 1, col 1, row 0
Second row, first column
row col clef : 1.0.2
cell.Tag : init ok, value clef 2, col 0, row 1
second row, second column
row col clef : 1.1.2
cell.Tag : init ok, value clef 2, col 1, row 1
etc...
All the data seem correct (it's normal that clef is increase)
But during the Cellule_Click sub, the data are:
First row, first column
row col clef : 0.1.1
cell.Tag : init ok, value clef 1, col 1, row 0
First row, second column
row col clef : 0.1.1
cell.Tag : init ok, value clef 1, col 1, row 0
Second row, first column
row col clef : 1.1.2
cell.Tag : init ok, value clef 2, col 1, row 1
second row, second column
row col clef : 1.1.2
cell.Tag : init ok, value clef 2, col 1, row 1
As you can see, the column number is always 1, I cannot have the good column number.
Do you see where is my mistake please ?