Select to view content in your preferred language

Bug : getAllLoadedWidgetIds function

991
4
02-11-2013 11:56 AM
KevinKimm
Deactivated User
I have noticed that the getAllLoadedWidgetIds returns Ids of even closed widgets. Anyone knows how to fix this bug and get only the truly opened widget lists?
Tags (2)
0 Kudos
4 Replies
RobertScheitlin__GISP
MVP Emeritus
Kevin,

   That is not a bug at all... You need to understand that when a widget is loaded  and then you close it, what is REALLY happening is that the widget is just being set to visible equals false. Thus this is why you are still seeing it in the loaded list. The getAllLoadedWidgetIds does not mean all visible widgets.
0 Kudos
KevinKimm
Deactivated User
Thanks, then how can I get a list of all the visible widgets?
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Kevin,

   There is not a quick and easy way to get that list. You would use the getAllLoadedWidgetIds list and then check if each in the list is visible or not.

                var visiblewidgetItems:ArrayCollection = new ArrayCollection();
                for each (var widgetId:Number in ViewerContainer.getInstance().widgetManager.getAllLoadedWidgetIds())
                {
                    if(ViewerContainer.getInstance().widgetManager.getWidget(widgetId).visible){
                        visiblewidgetItems.addItem(widgetId);
                    }
                }
0 Kudos
KevinKimm
Deactivated User
Dear Robert,

Thank you very much for your help. I finally fixed my problem thanks to your advice.
0 Kudos