Contents - Index - Top


AntViewDocument

 

The document interface is an additional interface to help you to communicate with the document presented in the WebView2 control. Almost all of the functionality is implemented with javascript. 

The functions presented below are available as additional helper functions.

 

Note that by design, communication in javascript with the WebView2 component is all done in an asynchronous way.

This means that when you want data in return from the control, you first have to request in method a) for the data and then wait for event b) to be raised to retrieve the data you asked for.

 

This can make using this functionality in legacy development environments a bit challenging.

In order to help with that, most methods listed below also have a synchronous alternative. 

It is important to know that you cannot use the synchronous methods directly from any of the events in the AntView control.

While the synchronous variants tend to be easier to use, we still recommend the asynchronous interface as that's "how the web works" and gives you most freedom, because it does not lock up the user interface while waiting for a task to complete.

Plus you can use the asynchronous methods from any of the AntView events.

 

The document interface can help by processing common tasks such as processing data in forms.

Some examples are:

- get/set data from input controls on html forms

- tick a checkbox

- press the submit button

- get/set content of html elements by Id or Name

- get/set the innerHtml of html elements by Id or Name

- send click to a html element

- test if a html element exists

- run javascript functions

 

One part that is in common with all the methods below is that you have to connect the document interface with the WebView2 control before you can use it. 

You do this with either the CurrentBrowser property or with the BrowserDispatch method when you want to connect it to the Browser, or the FrameDispatch method if you want to connect it to an iframe object.

 

Properties

AnonymousFunctionReturnParams

CurrentBrowser

ElementValueById

ElementValueByName

SynchronousTimeOut

 

Methods

BrowserDispatch

DecodeJsonObjectString

ElementClickById

ElementClickByIdSync

ElementClickByName

ElementClickByNameSync

ElementClickByQuerySelector

ElementClickByQuerySelectorSync

ElementHasAttributeById

ElementHasAttributeByIdSync

ElementHasAttributeByName

ElementHasAttributeByNameSync

ElementRemoveAttributeById

ElementRemoveAttributeByIdSync

ElementRemoveAttributeByName

ElementRemoveAttributeByNameSync

ElementToggleAttributeById

ElementToggleAttributeByIdSync

ElementToggleAttributeByName

ElementToggleAttributeByNameSync

FrameDispatch

RequestCurrentHtml

RequestCurrentHtmlSync

RequestCurrentText

RequestCurrentTextSync

RequestElementAttributeById

RequestElementAttributeByIdSync

RequestElementAttributeByName

RequestElementAttributeByNameSync

RequestElementExistsById

RequestElementExistsByIdSync

RequestElementExistsByName

RequestElementExistsByNameSync

RequestElementInnerHTMLById

RequestElementInnerHTMLByIdSync

RequestElementInnerHTMLByName

RequestElementInnerHTMLByNameSync

RequestElementInnerTextById

RequestElementInnerTextByIdSync

RequestElementInnerTextByName

RequestElementInnerTextByNameSync

RequestElementValueById

RequestElementValueByIdSync

RequestElementValueByName

RequestElementValueByNameSync

RequestFormSubmitById

RequestFormSubmitByIdSync

RequestFormSubmitByName

RequestFormSubmitByNameSync

RequestInputCheckboxById

RequestInputCheckboxByIdSync

RequestInputCheckboxByName

RequestInputCheckboxByNameSync

RequestPrint

RequestPrintSync

RunAnonymousFunction

RunAnonymousFunctionSync

SetElementAttributeById

SetElementAttributeByIdSync

SetElementAttributeByName

SetElementAttributeByNameSync

SetElementInnerHTMLById

SetElementInnerHTMLByIdSync

SetElementInnerHTMLByName

SetElementInnerHTMLByNameSync

SetElementInnerTextById

SetElementInnerTextByIdSync

SetElementInnerTextByName

SetElementInnerTextByNameSync

SetElementValueByIdSync

SetElementValueByNameSync

SetInputCheckboxById

SetInputCheckboxByIdSync

SetInputCheckboxByName

SetInputCheckboxByNameSync

 

Events

OnElementClickById

OnElementClickByName

OnElementClickByQuerySelector

OnElementHasAttributeById

OnElementHasAttributeByName

OnElementRemoveAttributeById

OnElementRemoveAttributeByName

OnElementToggleAttributeById

OnElementToggleAttributeByName

OnRequestCurrentHtml

OnRequestCurrentText

OnRequestElementAttributeById

OnRequestElementAttributeByName

OnRequestElementExistsById

OnRequestElementExistsByName

OnRequestElementInnerHTMLById

OnRequestElementInnerHTMLByName

OnRequestElementInnerTextById

OnRequestElementInnerTextByName

OnRequestElementValueById

OnRequestElementValueByName

OnRequestFormSubmitById

OnRequestFormSubmitByName

OnRequestInputCheckboxById

OnRequestInputCheckboxByName

OnRequestPrintCompleted

OnRunAnonymousFunction

OnSetElementAttributeById

OnSetElementAttributeByName

OnSetElementInnerHTMLById

OnSetElementInnerHTMLByName

OnSetElementInnerTextById

OnSetElementInnerTextByName

OnSetElementValueById

OnSetElementValueByName

OnSetInputCheckboxById

OnSetInputCheckboxByName

 


AntView - The MS Edge WebView2 ActiveX control Date last changed: 09/30/2024