Select to view content in your preferred language

Problem for widget open on eDraw and close Identify

794
2
Jump to solution
10-15-2013 06:13 AM
MayJeff
Deactivated User
When eDraw widget is opened, I added this line to close identify widget AppEvent.dispatch(AppEvent.WIDGET_CLOSE, ViewerContainer.getInstance().widgetManager.getWidgetId("Identify"))  inside these function - basewidget_widgetConfigLoaded(),  activateDrawTool(), and wTemplate_openHandler().   But Identify tool icon and hover tooltip on identify widget will still show up on the application.  See the attachment. 
Does anyone has this minor problem?

Thank you.
Tags (2)
0 Kudos
1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Emeritus
May Jeff,

   This is how you need to close a widget:

                var wId:Number = ViewerContainer.getInstance().widgetManager.getWidgetId("Identify");         var data:Object = {             id: wId,             state: WidgetStates.WIDGET_CLOSED          }         AppEvent.dispatch(AppEvent.WIDGET_STATE_CHANGED, data);

View solution in original post

0 Kudos
2 Replies
RobertScheitlin__GISP
MVP Emeritus
May Jeff,

   This is how you need to close a widget:

                var wId:Number = ViewerContainer.getInstance().widgetManager.getWidgetId("Identify");         var data:Object = {             id: wId,             state: WidgetStates.WIDGET_CLOSED          }         AppEvent.dispatch(AppEvent.WIDGET_STATE_CHANGED, data);
0 Kudos
MayJeff
Deactivated User
Robert,
I added the code you provided but Identify widget won't close when eDraw is opened. Can you tell what is the different to use AppEvent.dispatch(AppEvent.WIDGET_CLOSE, ViewerContainer.getInstance().widgetManager.getWidgetId("Identify")) & the code you provided?

If I change the code to this then Identify widget will close.
___________________________________________________________
for each (var widgetId:Number in ViewerContainer.getInstance().widgetManager.getAllLoadedWidgetIds()) {
    if(widgetId == 3) {
    var data:Object = {
    id: widgetId,
    state: WidgetStates.WIDGET_CLOSED
    };
    AppEvent.dispatch(AppEvent.WIDGET_CHANGE_STATE, data);
    }
    }
____________________________________________________________


Thank you very much.
0 Kudos