Select to view content in your preferred language

How to hide a widget icon on the toolbar?

3227
7
Jump to solution
07-12-2012 11:02 AM
ShaningYu
Honored Contributor
If I create such a widget that will pop out when it is needed.  If so, I don't want to have it on the toolbar.  Can I just set icon="" in the config.xml?
Tags (2)
0 Kudos
1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Emeritus
Shaning,

   Hooray... This question is in the right forum. No you can not just exclude the widget icon because a default icon will be used. You will have to make changes to the HeaderControllerWidget.mxml to exclude your specific widget from being added. If you look at the getWidgetItems function you can add code to check if the widget label == yourwidget and if so then use the continue statement to jump to the next item.

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:

View solution in original post

0 Kudos
7 Replies
AnthonyGiles
Honored Contributor
Shaning

Try placing the widget in the UI area of your config

Regards

Anthony
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Shaning,

   Hooray... This question is in the right forum. No you can not just exclude the widget icon because a default icon will be used. You will have to make changes to the HeaderControllerWidget.mxml to exclude your specific widget from being added. If you look at the getWidgetItems function you can add code to check if the widget label == yourwidget and if so then use the continue statement to jump to the next item.

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
ShaningYu
Honored Contributor
Robert:
Thanks so much for your multiple times of advices and help.  Solute to your great contributions.
Shaning
0 Kudos
AnthonyGiles
Honored Contributor
Shaning

I have tried this solution and it works fine with no need for coding if you are using the compiled code
Shaning

Try placing the widget in the UI area of your config

Regards

Anthony


anthony
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Anthony,

   Does this not force the widget to automatically be loaded at startup though?.. If you want to open the widget from code based on some user click than adding it as a UI element is not the best route.
If I create such a widget that will pop out when it is needed.
0 Kudos
AnthonyGiles
Honored Contributor
Robert,

Yes it does, mis-read original post just thought the widget wanted to be open at start up with no icon in the banner

Regards

Anthony
0 Kudos
ShaningYu
Honored Contributor
I used Robert's approach to add the following code in getWidgetItems(widgetList:Array)
   ...

   if (widgetItem.label.toString() ! = "Find An Address") {
       widgetItem.open = widgetList.preload && (widgetList.preload == "open" || widgetList.preload == "minimized");
       menuItems.addItem(widgetItem);
   }
It works well
0 Kudos