Velocity.enterField()
Overview
Enters a field scope based on code running in the web view. Prepends the current page scope to the beginning of the scope being entered. The Velocity.exitField function should be called when the page changes or focus changes.
Added in version 1.2.109
Only available in the Web View engine context. For more information, see Velocity Scripting APIs.
Use Cases
To change the field scope when the focus changes in the web view.
Format
Velocity.enterField(fieldName);
Parameter | Description | Type | Required | Notes |
---|---|---|---|---|
fieldName | The name of the field to enter. | String | Required | See WLEvent.enterScope() |
Example
Copy
/* Enter @/path/test1.html:field1 scope if an element with the id of field1 exists.
*/
View.evaluateJavascript(
"if(document.getElementById('field1')) {" +
" Velocity.enterField('field1');" +
"}"
);