ok i understand what is the problem @Erel
when you add the tableview to a panel it will work as long as you wont have panel_click event
because on click the panel catch the click and not the tableview
try to add the tableview to a panel that also has a click event
EDIT: the reason why my panels have click event is i want to prevent that on click (somewhere on the panel) an underlying button or panel wont catch that click so i add a click event to the panel and when you touch the panel catch the click but it should be that if the panel as views in it and they also have click (touch) event then they should catch the touch (this is how i understood it, the z order is important, the view that is in front should always catch the touch, correct?)
i just add the tableview (the same code as you post above) to a simple panel (instead to the page) and that panel also has a click event.
the tableview code is the same as in your tableview example:
B4X:
TableView1.Initialize("TableView1", False)
For i = 1 To 1000
Dim tc As TableCell = TableView1.AddSingleLine($"Item #${i}"$)
tc.AddActionButton("Delete", Colors.Red)
tc.AddActionButton("Change Value", Colors.Green)
Next
Page1.RootPanel.AddView(TableView1, 0, 0, 100%x, 100%y)
only instead of Page1.RootPanel.AddView(TableView1, 0, 0, 100%x, 100%y) i use Panel1.AddView(TableView1, 0, 0, 100%x, 100%y)
You are correct. The background panel consumes the touch event. Note that it is not related to the action buttons. You will need to remove the Click event from the panel.
do you mean the actionbuttons? if yes then yes they are still clickable. they act like usual buttons only the tableview items dont catch the clicks if i add the tableview to a panel that has a click_event.
oh sorry, i understand now you question. as you can see in the video my panel is about 80% of the screen size and the tableview doesnot cover all the panel size only a part of it so even if the tabelview will prevent underlying views to be clicked (after i remove the click event) there is still a small place where it can happen (below the tableview and between the 2 buttons)
normally i always add to parent panels a click event that is empty only to avoid such a behavior. to be true i never understood why it is working like this in B4x that an underlying view can be clicked if the above view doesnot have a click event. in VB you cannot do this. is this a JAVA feature?
EDIT: i guess i will need to move all views to 105%x instead of onlye ( visible = false ) when i switch between panels.
to be true i never understood why it is working like this in B4x that an underlying view can be clicked if the above view doesnot have a click event. in VB you cannot do this. is this a JAVA feature?
i have under the tableview a panel that is a child of the main panel. so i will need to hande the touch event? and get the x/y of the touch and like this know what item was selected? (this could be a possibility, i also thought about it. i will see how to solve it) thanx erel