Select to view content in your preferred language

Closed widget still active in display

1434
6
Jump to solution
05-17-2012 09:51 AM
BradleyMontgomery
Emerging Contributor
I'm using one widget to pop up another widget with some results of a search. I want both widgets to close when the user closes the main calling widget. I'm using this code to close the popped up widget from within the close function of the calling widget:

private function closeWidget(e:Event = null):void
{
    AppEvent.dispatch(AppEvent.WIDGET_CLOSE,ViewerContainer.getInstance().widgetManager.getWidgetId("poppedUpWidget"));
}

Both widgets disappear but the space on the display where the popped up widget still behaves as if the widget was still there. I get tooltips when I hover over it, the Zoom crosshairs disappear when I move them over that space...

I've also tried the code from this post:

http://forums.arcgis.com/threads/25015-closing-multiple-widgets

with no results.

If the user clicks the 'x' to close the popped up widget, all is well. The widget disappears and the space it occupied is truly empty. It only happens when the popped up widget is closed from the calling widget.

This is basically the same problem described in this thread:

http://forums.arcgis.com/threads/44976-Close-widget-can-still-click-buttons?highlight=widget+close
Tags (2)
0 Kudos
1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Emeritus
Charlie,

   I see what you are talking about. It is still a timing issue though. Change the 501 to 700 and that fixed it for me.

View solution in original post

0 Kudos
6 Replies
RobertScheitlin__GISP
MVP Emeritus
Charlie,

   This is what works for me. Just put this in the WidgetClose function of the main widget and set the label in this function to the label of the other widget you want closed:

                var timer:Timer = new Timer(501, 1);
                timer.addEventListener(TimerEvent.TIMER_COMPLETE, function():void{
                    var cId2:Number = ViewerContainer.getInstance().widgetManager.getWidgetId("Point Buffer");
                    AppEvent.dispatch(AppEvent.WIDGET_CLOSE, cId2);
                });
                timer.start();


Don't forget to click the Mark as answer check on this post and to click the top arrow (promote).
Follow the steps as shown in the below graphic:
0 Kudos
BradleyMontgomery
Emerging Contributor
Thanks Robert! That does indeed close the popped up widget. I no longer see the tooltips when I pan move the mouse over where it was before it closed. However, now I'm having the problem with the calling widget. Where it used to be completely gone with the original methods I was using, it disappears but when I move the cursor over where it was, the browser thinks it's still there - zoom crosshairs disappear, tooltips pop up ... One thing is fixed but another is broken.
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Charlie,

   Did you modify the time in the timer? I set it to 501 for a reason.
0 Kudos
BradleyMontgomery
Emerging Contributor
I left it at 501. I just copied the code straight from the browser and pasted it into Flash Builder changed the name of the window and ran it.
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Charlie,

   I see what you are talking about. It is still a timing issue though. Change the 501 to 700 and that fixed it for me.
0 Kudos
BradleyMontgomery
Emerging Contributor
That was it! Thank you so much! It's amazing how you are able to figure all this out.
0 Kudos