WebBrowser external object

Official Content
This documentation is valid for:

The WebBrowser external object allows you to handle events related to web-designed applications which are embedded in a Smart Device application.

  WebBrowserexternalobject

Methods

Open method

Open an inline web browser, displaying the given URL. This method replaced the OpenInBrowser method of Interop external object

Input url:URL
Output None

Close method

Close the inline web browser.

Input None
Output None

Events

BeforeNavigate event

This event is triggered before navigating any URL on an embedded web application (i.e. when the end user taps on a link in a web view before opening it in a browser). Also, it is possible to indicate if the app calls to the browser or not by setting the output parameter to True (which will be set at False by default).

True The object is embedded
False Calls to the browser
 
Input url:URL
  handled:Boolean
Output None

OnClose event

This event is triggered when the web-view, opened within a Smart Devices application, is closed. It is very helpful to code communication between the mobile and web applications.

Input url:URL
Output  None

Example 

BeforeNavigate event

Suppose we allow our end-user to log in on a website which is displayed on the app by using a Component (or WebView).
In case that the login navigates a certain callback URL, the following event should be written:

//To call the URL embedded
Event GeneXus.SD.WebBrowser.BeforeNavigate(&Url, &Handled)
   composite
      if &Url = !"<my_callback_url>" 
         <your_code>
      	 &Handled = true
      endif
   endcomposite
EndEvent

//To call the URL to open in a browser
Event GeneXus.SD.WebBrowser.BeforeNavigate(&Url, &Handled)
   composite
      if &Url = !"<my_callback_url>"
         <your_code>
         &Handled = false
      endif
   endcomposite
EndEvent

Notes

Scope

Platforms  Smart Devices (iOS, Android)

Availability

This external object is available as of GeneXus 15 Upgrade 7, with BeforeNavigate event. As of GeneXus 16 upgrade 3 OnClose event, and Open and Close method are added, but temporary only for iOS.




Was this page helpful?
What Is This?
Your feedback about this content is important. Let us know what you think.