Ticket #1282 (closed bug: invalid)

Opened 5 years ago

Last modified 5 years ago

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

Change History

follow-up: ↓ 2   Changed 5 years ago by hpbrantley

After further investigation I believe this is in the navigation tool. When it is enabled, the pan becomes default regardless. If this is not enabled, defaultControl works as expected.

in reply to: ↑ 1   Changed 5 years ago by elemoine

  • status changed from new to closed
  • resolution set to invalid

Replying to hpbrantley:

After further investigation I believe this is in the navigation tool. When it is enabled, the pan becomes default regardless. If this is not enabled, defaultControl works as expected.

That's correct. I'm closing this ticket since there seems to be no problem with Panel.defaultControl. Feel free to reopen if you think I'm missing the point and there actually is an issue.

Note: See TracTickets for help on using tickets.