Hi All,<div><br></div><div>I&#39;m running into a bit of a snag and am hoping someone can offer some advice.  I&#39;m trying to build a map with multiple control panels, ie: Basic Navigation, Querying (draw a shape, generate a query based off the shape) etc.  For the most part its going quite well, but I&#39;m running into a problem where I activate a control in one panel, click on a button in another panel, and the original controls remain active and both try to run... in other words, I&#39;ll turn on an Info control, and then switch to DrawPoint, and it&#39;ll be trying to do both.  Controls deactivate other controls within their own panel when clicked, but don&#39;t seem to know to deactivate the other panel&#39;s controls.</div>
<div><br></div><div>Is there a straightforward way to do this?  Thus far, the best idea I&#39;ve come up with (shown below) is setting a listener for each control when it activates, such that it runs through everything in the other panel.controls, and deactivates them all.  This strikes me as painfully awkward, and gets extremely annoying to scale if I choose to add a few more panels.  Is there any way to make the panels aware of each other&#39;s existence such that they deactivate the controls appropriately (or can anyone suggest a better of implementing this)?</div>
<div><br></div><div>Thanks!</div><div><br></div><div>Josh</div><div><br></div><div><br></div><div>given two external panels, <span class="Apple-style-span" style="font-style: italic;">panel</span> and <span class="Apple-style-span" style="font-style: italic;">selPan2</span>, run the following at the end of initialization.</div>
<div><br></div><div><span class="Apple-style-span" style="font-style: italic;"><div><div>for (eachControl in panel.controls) {</div><div>    panel.controls[eachControl].events.register(&quot;activate&quot;,selPan2.controls,function () {</div>
<div>        for (otherControls in this) {</div><div>            this[otherControls].deactivate();</div><div>        }</div><div>    });</div><div>}</div><div><br></div><div>for (eachControl in selPan2.controls) {</div><div>
    selPan2.controls[eachControl].events.register(&quot;activate&quot;,panel.controls,function () {</div><div>        for (otherControls in this) {</div><div>            this[otherControls].deactivate();</div><div>        }</div>
<div>    });</div><div>}</div><div><br></div></div></span></div>