src/aria/templates/TemplateCtxt.js
function (idArray) {
            ariaUtilsDelegate.ieFocusFix();
            var idToFocus;
            if (ariaUtilsType.isArray(idArray)) {
                idArray = idArray.slice(0);
                idToFocus = idArray.shift();
            } else {
                idToFocus = idArray;
                idArray = [];
            }
            if (!idToFocus) {
                return;
            }
            var focusSuccess = false; // First look for widget...
            var widgetToFocus = this.getBehaviorById(idToFocus);
            if (widgetToFocus && (typeof(widgetToFocus.focus) != "undefined")) {
                widgetToFocus.focus(idArray);
                focusSuccess = true;
            }
            // ... then look for arbitrary dom element with id
            if (!focusSuccess) {
                var domElementId = this.$getId(idToFocus);
                var elementToFocus = ariaUtilsDom.getElementById(domElementId);
                if (elementToFocus) {
                    elementToFocus.focus();
                    focusSuccess = true;
                }
            }
            if (!focusSuccess) {
                this.$logError(this.FOCUS_FAILURE, [idToFocus, this.tplClasspath]);
            }
        }
function (idArray) {
            ariaUtilsDelegate.ieFocusFix();
            var idToFocus;
            if (ariaUtilsType.isArray(idArray)) {
                idArray = idArray.slice(0);
                idToFocus = idArray.shift();
            } else {
                idToFocus = idArray;
                idArray = [];
            }
            if (!idToFocus) {
                return;
            }
            var focusSuccess = false; // First look for widget...
            var widgetToFocus = this.getBehaviorById(idToFocus);
            if (widgetToFocus && (typeof(widgetToFocus.focus) != "undefined")) {
                widgetToFocus.focus(idArray);
                focusSuccess = true;
            }
            // ... then look for arbitrary dom element with id
            if (!focusSuccess) {
                var domElementId = this.$getId(idToFocus);
                var elementToFocus = ariaUtilsDom.getElementById(domElementId);
                if (elementToFocus) {
                    elementToFocus.focus();
                    focusSuccess = true;
                }
            }
            if (!focusSuccess) {
                this.$logError(this.FOCUS_FAILURE, [idToFocus, this.tplClasspath]);
            }
        }
function ( idArray ) { ariaUtilsDelegate . ieFocusFix ( ) ; var idToFocus ; if ( ariaUtilsType . isArray ( idArray ) ) { idArray = idArray . slice ( 0 ) ; idToFocus = idArray . shift ( ) ; } else { idToFocus = idArray ; idArray = [ ] ; } if ( ! idToFocus ) { return ; } var focusSuccess = false ; // First look for widget... var widgetToFocus = this . getBehaviorById ( idToFocus ) ; if ( widgetToFocus && ( typeof ( widgetToFocus . focus ) != "undefined" ) ) { widgetToFocus . focus ( idArray ) ; focusSuccess = true ; } // ... then look for arbitrary dom element with id if ( ! focusSuccess ) { var domElementId = this . $getId ( idToFocus ) ; var elementToFocus = ariaUtilsDom . getElementById ( domElementId ) ; if ( elementToFocus ) { elementToFocus . focus ( ) ; focusSuccess = true ; } } if ( ! focusSuccess ) { this . $logError ( this . FOCUS_FAILURE , [ idToFocus , this . tplClasspath ] ) ; } }
Focus a widget with a specified id programmatically. This method can be called from templates and
template scripts. If the focus fails, an error is thrown.
@param {String|Array} containing a path of ids of the widget to focus
@implements aria.templates.ITemplate
Focus a widget with a specified id programmatically . This method can be called from templates and template scripts . If the focus fails an error is thrown .