Hello,
I would like to be able to catch pop-up from webpages, such as the alerts and prompts. I need to display those pop up in the webview, because I need the user to log in with windows credentials. I have tried using the CreateEvent method from JavaObject and calling the onAlert Method (http://docs.oracle.com/javase/8/javafx/api/javafx/scene/web/WebEngine.html#onAlertProperty) of the webengine, but no luck so far.
Can someone help me? I can't figure it out.
Thanks everyone
I would like to be able to catch pop-up from webpages, such as the alerts and prompts. I need to display those pop up in the webview, because I need the user to log in with windows credentials. I have tried using the CreateEvent method from JavaObject and calling the onAlert Method (http://docs.oracle.com/javase/8/javafx/api/javafx/scene/web/WebEngine.html#onAlertProperty) of the webengine, but no luck so far.
Can someone help me? I can't figure it out.
B4X:
Sub AppStart (Form1 As Form, Args() As String)
MainForm = Form1
MainForm.RootPane.LoadLayout("Main") 'Load the layout file.
MainForm.Show
we.InitializeNewInstance("javafx.scene.web.WebEngine",Null)
wvjo = wv
we = wvjo.RunMethod("getEngine",Null)
Dim e As Object = we.CreateEvent("javafx.scene.web.WebEngine.setOnAlert", "wv", False)
we.RunMethod("setOnAlert", Array(e))
End Sub
Sub wv_Event(MethodName As String, Args() As Object)
Log(MethodName)
End Sub
Thanks everyone