ModuleObject.focus

Syntax

focus();

Description

The focus method processes passing focus to a module or its elements.

Comments

Method implementation depends on classes inherited from ModuleObject. Currently, this method is implemented only by PP.Application.EaxModuleObject.

Example

Executing the example requires that an express report is opened and the script given below is started in the browser console.

Call handlers of the blur, focus and focusout events and check how they affect the express report change:

// Get current unit object
var moduleObject = PP.App.getModuleObject();
// Determine a function to check if express report has been changed
var defineIsChanged = function (event) {
    if (moduleObject.setIsChanged()) {    
        console.log("Express report after handling of event " + event +
            " has been changed");
        // Reset whether express report has been changed
        moduleObject.setIsChanged(null);
    } else {    
        console.log("Express report after handling event " + event +
            " has not been changed");
    };
};
// Set whether express report has not been changed
moduleObject.setIsChanged(null);
// Handle event of removing focus from form input boxes
moduleObject.blur();
// Check of express report is changed
this.defineIsChanged("blur");
// Handle event of moving focus to unit or its elements
moduleObject.focus();
// Check if express report is changed
this.defineIsChanged("focus");
// Handle event of removing focus from unit or its element
moduleObject.focusout("focusout");
// Check if express report is changed
this.defineIsChanged();

After executing the example it is found that the blur and focusout event handlers do not affect the indication of express report change, and the focus event handler indicates that the express report has been changed:

Express report after processing the blur event has not been changed

Express report after processing the focus event has been changed

Express report after processing the undefined event has not been changed

See also:

ModuleObject