Velocity.enterScope()
Overview
Enters a scope based on code running in the web view.
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.enterScope(scopeName);
Parameter | Description | Type | Required | Notes |
---|---|---|---|---|
scopeName | The name of the scope to enter. | String | Required | See WLEvent.enterScope() |
Example 1
Copy
/* Enter field1 scope if an element with the id of field1 exists.
*/
View.evaluateJavascript(
"if(document.getElementById('field1')) {" +
" Velocity.enterScope('field1');" +
"}"
);