D DawningTruth Active Member Licensed User Mar 2, 2019 #1 My activity has more than one webview. How do I determine which webview triggered the Page Finished event? Code: Copy Sub myWebview_PageFinished(Url As String) Log("myWebview Attributes") Log(Url) 'This is the right url Log(myWebview) 'This is the wrong webview End Sub It looks like the standard approach only supplies the url. I want to also get the webview that triggered the event. How do I do this?
My activity has more than one webview. How do I determine which webview triggered the Page Finished event? Code: Copy Sub myWebview_PageFinished(Url As String) Log("myWebview Attributes") Log(Url) 'This is the right url Log(myWebview) 'This is the wrong webview End Sub It looks like the standard approach only supplies the url. I want to also get the webview that triggered the event. How do I do this?
Computersmith64 Well-Known Member Licensed User Longtime User Mar 3, 2019 #2 OK - so presumably you are initializing them both with the same event name - ie: .Initialize("myWebview")? If so, just use Sender to get the correct one: Code: Copy Sub myWebview_PageFinished(Url As String) Private thisWebView as WebView = Sender Log("myWebview Attributes") Log(Url) 'This is the right url Log(thisWebView) 'This is the webview that fired the PageFinished event. End Sub - Colin. Upvote 0
OK - so presumably you are initializing them both with the same event name - ie: .Initialize("myWebview")? If so, just use Sender to get the correct one: Code: Copy Sub myWebview_PageFinished(Url As String) Private thisWebView as WebView = Sender Log("myWebview Attributes") Log(Url) 'This is the right url Log(thisWebView) 'This is the webview that fired the PageFinished event. End Sub - Colin.
D DawningTruth Active Member Licensed User Mar 3, 2019 #3 Computersmith64 said: OK - so presumably you are initializing them both with the same event name - ie: .Initialize("myWebview")? If so, just use Sender to get the correct one: Code: Copy Sub myWebview_PageFinished(Url As String) Private thisWebView as WebView = Sender Log("myWebview Attributes") Log(Url) 'This is the right url Log(thisWebView) 'This is the webview that fired the PageFinished event. End Sub - Colin. Click to expand... Thx Colin. Worked like a charm Upvote 0
Computersmith64 said: OK - so presumably you are initializing them both with the same event name - ie: .Initialize("myWebview")? If so, just use Sender to get the correct one: Code: Copy Sub myWebview_PageFinished(Url As String) Private thisWebView as WebView = Sender Log("myWebview Attributes") Log(Url) 'This is the right url Log(thisWebView) 'This is the webview that fired the PageFinished event. End Sub - Colin. Click to expand... Thx Colin. Worked like a charm