B4J Question Add webview to listview

cstangor

Member
Licensed User
Longtime User
I'd like to add html formatted items to my listview. I can add a webview or a panel containing a webview and they display fine but the mouseclick event doesn't recognize them in the same way it recognizes a label.

Thanks in advance

B4X:
Sub AppStart (Form1 As Form, Args() As String)
    MainForm = Form1
    MainForm.RootPane.LoadLayout("Layout1") 'Load the layout file.
    Dim lbl As Label: lbl.Initialize("lv")
    lbl.Text = "lbl1"
    lv.Items.Add(lbl)
    Dim wv As WebView: wv.Initialize("lv")
    wv.LoadHtml("wv")
    Dim p As Pane: p.Initialize("")
    p.AddNode(wv, 0, 0, lv.Width, lv.Height/4)
    lv.Items.Add(p)
    MainForm.Show
End Sub

Sub lv_MouseClicked (EventData As MouseEvent)
    Log (lv.SelectedItem & " " & lv.SelectedIndex)
   
End Sub
 
Top