Velocity API: WLEvent.enterScope()

Version 1

    Return To Index

    WLEvent.enterScope()

    Overview

    Enters a scope, adds it to the scope stack, and calls all registered functions for that scope. An event handler list associated with that scope is prepared. The new scope is added to the top of the scope stack. New event handlers will default to being registered with the scope that is on top of the scope stack. Triggers the “EnterScope” event before invoking any of the scope's registered functions.

    You may have more than one custom scope at a time.

    Added in version 1.2.0

    See Also
    • WLEvent.exitScope()

    Format

     

    var scopeEntered = WLEvent.enterScope(scope);
    ParameterDescriptionTypeRequiredNotes
    scopeThe scope being entered.StringRequiredSee WLEvent.registerScope() Velocity Scopes
    scopeEnteredThe return value. True if the scope was successfully entered.BooleanReturn

     

    Example

    /* Invokes all registered functions associated with the 
    * "mySpecial" scope.
    */
      
    WLEvent.enterScope("mySpecial");