Bug? iTableView SelectedChanged event not raised when background panel handles a Click event

b4x-de

Active Member
Licensed User
Longtime User
I discovered an issue then placing an iTableView on a panel that handles a Click event. In this case the iTableView SelectedChanged event is not raised.

I consider this to be a bug because this behavior is different from the behavior of all other views. Other views are not affected by the click event of a background panel, i.e. a Picker event is raised although the background panel handles the click event. Therefore I would like to file this as a bug.

Please find the project to confirm this issue attached to this post. The following section shows the event handling:

B4X:
Private Sub Application_Start (Nav As NavigationController)
    Dim items(5) As String
   
    NavControl = Nav
   
    Page1.Initialize("Page1")
    Page1.RootPanel.LoadLayout("Page1")
    NavControl.ShowPage(Page1)
       
    Wait For Page1_Resize(Width As Int, Height As Int)
   
    tbvDemo.Clear
    For i = 0 To 4
        items(i) = "No. " & i
        tbvDemo.AddSingleLine(items(i))
    Next
    tbvDemo.ReloadAll

    pckDemo.SetItems(0, items)
End Sub

Private Sub Page1_Resize(Width As Int, Height As Int)

End Sub

Sub tbvDemo_SelectedChanged (SectionIndex As Int, Cell As TableCell)
    Log("Event tbvDemo_SelectedChanged only raised, when background Click is not handled.")
End Sub

' please choose project configuration from toolbar to test this issue
#IF ENABLED
Sub pnlTableViewBackground_Click
    Log("Event pnlTableViewBackground_Click raised")
    pnlTableViewBackground.Visible = False
End Sub
#END IF

Sub btnOpenTableView_Click
    pnlTableViewBackground.Visible = True
End Sub

Sub btnDismiss_Click
    pnlTableViewBackground.Visible = False
End Sub

Sub pckDemo_ItemSelected (Column As Int, Row As Int)
    Log("Event pckDemo_ItemSelected is raised, even when background Click is handled.")
End Sub

Thanks,
Thomas
 

Attachments

  • iTableViewBug.zip
    3.1 KB · Views: 145
Top