S Samplatiner Member Licensed User Longtime User Aug 12, 2015 #1 Good morning b4x-communicty, I have a question to the tableview. I want to detect clicks and longclicks, but they do not have Parameters, which row is clicked. this thread https://www.b4x.com/android/forum/threads/tableview-click-longclick-and-clicked-cell.52981/ says, i sould use selectedchange, but this Event does not fire as Long as I have a click/longclick-detection active. So how to get which line his been clicked? I would be happy about a good hint Best regards, Daniel
Good morning b4x-communicty, I have a question to the tableview. I want to detect clicks and longclicks, but they do not have Parameters, which row is clicked. this thread https://www.b4x.com/android/forum/threads/tableview-click-longclick-and-clicked-cell.52981/ says, i sould use selectedchange, but this Event does not fire as Long as I have a click/longclick-detection active. So how to get which line his been clicked? I would be happy about a good hint Best regards, Daniel
S Samplatiner Member Licensed User Longtime User Aug 12, 2015 #2 I have to correct this a bit. Only the Click-Event (even if empty) blocks the selectedchange-Event if I comment the click-Event, the selectedchange-Event fires Upvote 0
I have to correct this a bit. Only the Click-Event (even if empty) blocks the selectedchange-Event if I comment the click-Event, the selectedchange-Event fires
Erel B4X founder Staff member Licensed User Longtime User Aug 12, 2015 #3 You should use TableView Click events. It will consume the touch event and prevent the SelectedChange from firing. Upvote 0
You should use TableView Click events. It will consume the touch event and prevent the SelectedChange from firing.
S Samplatiner Member Licensed User Longtime User Aug 12, 2015 #4 I used the click Events and I yes, they block the selectedchange-Event but that's the Problem. without the selectedChange-Event I do not know, on which row the user has klicked, so I can't start the interaction with the click row. How do I get the Information, on which row the user has clicked? the click Event does not have any Parameters Edit: A Screenshot: http://www.pic-upload.de/view-27979550/pic.png.html Upvote 0
I used the click Events and I yes, they block the selectedchange-Event but that's the Problem. without the selectedChange-Event I do not know, on which row the user has klicked, so I can't start the interaction with the click row. How do I get the Information, on which row the user has clicked? the click Event does not have any Parameters Edit: A Screenshot: http://www.pic-upload.de/view-27979550/pic.png.html
S Samplatiner Member Licensed User Longtime User Aug 12, 2015 #5 do I have maybe an old Version of Tableview? it's 1.2 Upvote 0
S Samplatiner Member Licensed User Longtime User Aug 12, 2015 #6 no, 1.2 is the new one, that's not the problem Upvote 0
Erel B4X founder Staff member Licensed User Longtime User Aug 12, 2015 #7 You shouldn't handle the Click event. You can add custom views to the items and then handle their events. For example you can add panels and handle their click events. Upvote 0
You shouldn't handle the Click event. You can add custom views to the items and then handle their events. For example you can add panels and handle their click events.
S Samplatiner Member Licensed User Longtime User Aug 12, 2015 #8 great, that's perfect. thanks a lot, that works great. while creating the rows now I have added the index as a tag to the Panels. Every Panel has the same eventname, so it's that easy: Code: Sub pnlTableTablet_Click Dim pnl As Panel=Sender Dim index as int=pnl.Tag End Sub Upvote 0
great, that's perfect. thanks a lot, that works great. while creating the rows now I have added the index as a tag to the Panels. Every Panel has the same eventname, so it's that easy: Code: Sub pnlTableTablet_Click Dim pnl As Panel=Sender Dim index as int=pnl.Tag End Sub