Android Question Table.GetValue(0,SelectedID) not getting the correct value of column 0

Aries Abedes

Member
Licensed User
Hi,

I am trying to use this CellClick code

B4X:
Sub tblImirDestialsList_CellClick(row As Int, col As Int) 
       
    SelectedRow = row
    SelectedID = tblImirDestialsList.GetValue(0,SelectedRow)
    Log(row)
    Log(SelectedID)
               
End Sub

But i got the wrong id as it shows in the log when i click a single cell on the table. Attached is a sample image where I click on cell with the ID of 135. I have almost read the entire flexible table thread but i cannot see a solution (or may be i missed it). I hope you can help me with it. Thank you.

B4X:
** Activity (main) Pause, UserClosed = false **
** Service (starter) Create **
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
** Activity (main) Pause, UserClosed = false **
** Activity (alogin) Create, isFirst = true **
** Activity (alogin) Resume **
** Service (httputils2service) Create **
** Service (httputils2service) Start **
Class not found: b4j.example.main$_dbresult, trying: b4a.example.main$_dbresult
OK
** Activity (alogin) Pause, UserClosed = false **
** Activity (aimircontrol) Create, isFirst = true **
** Activity (aimircontrol) Resume **
1
136
 

Attachments

  • Screenshot_2017-03-09-14-24-16.png
    Screenshot_2017-03-09-14-24-16.png
    116.7 KB · Views: 146

Aries Abedes

Member
Licensed User
I see..i got those code when i generate it from the designer. I've been struggling for almost a week now with these :) I'll try it now...

Thanks Erel.
 

Attachments

  • generate cellclick.png
    generate cellclick.png
    132.6 KB · Views: 230
Upvote 0

Aries Abedes

Member
Licensed User
Yes. I think i found it. Sorry to bother :)

Thank you for reporting this:
You should not change in the Cell_Click and Cell_LongClick routines, it has been so since the beginning.
You should change:
#Event: CellClick(row As Int, col As Int)
#Event: CellLongClick(row As Int, col As Int)
to
#Event: CellClick(col As Int, row As Int)
#Event: CellLongClick(col As Int, row As Int)
 
Upvote 0
Top