Velocity.exitScope()
Overview
Exits a scope based on code running in the web view.
Added in version 1.2.109
Only available in the WebView 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.exitScope(scopeName);
Parameter | Description | Type | Required |
---|---|---|---|
scopeName | The name of the scope to exit. | String | Required |
Example
Copy
/* Exit field1 scope if an element with the id of field1 is not found.
*/
View.evaluateJavascript(
"if(!document.getElementById('field1')) {" +
" Velocity.exitScope('field1');" +
"}"
);