Ticket #1282 (closed bug: invalid)
panel.defaultControl not functioning as expected
| Reported by: | hpbrantley | Owned by: | |
|---|---|---|---|
| Priority: | minor | Milestone: | |
| Component: | Control | Version: | 2.5 |
| Keywords: | panel defaultcontrol | Cc: | hpbrantley@… |
| State: |
Description
When you create a panel and set a defaultControl, it is expected that this control be active by default. It is highlighted but not active. Calling panel.activateControl(CONTROL); after the map object is created seems to solve it.
See http://maps.cpc-fis.vanderbilt.edu/defaultControlBug.html for example.
When the map is initialized, it loops through the controls with code:
for(var i=0; i < this.controls.length; i++) {
this.addControlToMap(this.controls[i]);
}
Could this be modified to something like:
for(var i=0; i < this.controls.length; i++) {
this.addControlToMap(this.controls[i]); if(this.controls[i].defaultControl) {
this.controls[i].activate();
}
}
hpbrantley AT gmail DOT com
