Control.getFocused

Syntax

getFocused ();

Description

The getFocused method determines if component is focused.

Comments

The method returns True if component is focused, and False if otherwise.

Example

To execute the example, in the <head> tag of HTML page add links to the PP.js and PP.css files. Add the TextBox component to the page, set focus for the component and set a four second timeout for tooltip displaying:

 tb = new PP.Ui.TextBox({
    ParentNode: document.body,
    Content: "Text",
    ToolTip: "Enter some text",
    Width: 100
 });
 if (tb.getFocused() == false) {
    tb.setFocus()
 };
 PP.setTimeout(function () {
    tb.hideToolTip()
 }, 4000);

After executing the example the page will contain the TextBox component with the set focus. A toolip shown for four seconds is set for the component.

See also:

Control