getFocused();
The getFocused method determines if component is focused.
The method returns True if component is focused, and False if otherwise.
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 it and determine timeout 4 seconds for displaying a tooltip:
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: