3.0 beta 2

Tab key auto-repeat causes CPU overload

I'm using ActiveWidgets in a web-based replacement of a field-intensive desktop database application and initial user testing has turned up a very annoying situation. The users are used to holding down the Tab key for extended periods of time to tab around the screen. On an ActiveWidgets-based screen, however, doing this for as little as 2-3 seconds causes the browser to go into some kind of infinite loop. The CPU usage goes up to 90+% and stays there, and the cursor starts bouncing around to random places on the web page. Exiting the web page restores normal operation.

I was able to reproduce this problem in the examples\new\controls.htm sample page. Just load that page into your browser and hold down the tab key for a couple of seconds and watch what happens. The problem goes away when I remove the combo field from that page, but I see the problem on other pages in my application that don't include a combo field, so it is not exclusive to the combo field. It appears that the event processing in AW is getting tangled up in knots, but I'm still learning my way around the source code so I can't easily figure out what is happening here.

Is anyone else seeing this problem? Are there any known workarounds? Or fixes?
Randall Severy
January 18,
yes, I can reproduce this, the problem seems to be related to the timeout before the start of editing code. Hopefully this patch will fix it -

(function(){

    function _focus(event){
        var e = this.getContent("box/text").element();
        if (e && event.srcElement != e ){
            this.setTimeout(function(){
                if (this.$active){
                    e.setActive();
                }
            });
        }
    }

    function _edit(){
        this.setTimeout(function(){
            if (this.$active){
                this.startEdit();
            }
        });
    };

    new AW.UI.Button;
    new AW.UI.Link;
    new AW.UI.Input;
    new AW.UI.Combo;

    AW.UI.Button.prototype.setEvent("onactivate", _focus);
    AW.UI.Link.prototype.setEvent("onactivate", _focus);
    AW.UI.Input.prototype.setEvent("onactivate", _focus);
    AW.UI.Combo.prototype.setEvent("onactivate", _focus);

    AW.UI.Input.prototype._itemController.onControlActivated = _edit;
    AW.UI.Combo.prototype._itemController.onControlActivated = _edit;

})();
Alex (ActiveWidgets)
January 23,

This topic is archived.

See also:


Back to support forum

Search

Version 2

Looking for AW 2.6 ?
The old site is here.