<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How can I toggle the visibility of a widget?  in ArcGIS Web AppBuilder Questions</title>
    <link>https://community.esri.com/t5/arcgis-web-appbuilder-questions/how-can-i-toggle-the-visibility-of-a-widget/m-p/535303#M14084</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jamie, I tried Robert's codes, and it worked for Foldable Theme, but didn't work for Launchpad theme even i have changed the "HeaderController" to "AnchorBarController". Did they work for you?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 20 Dec 2016 15:50:52 GMT</pubDate>
    <dc:creator>Alexwang</dc:creator>
    <dc:date>2016-12-20T15:50:52Z</dc:date>
    <item>
      <title>How can I toggle the visibility of a widget?</title>
      <link>https://community.esri.com/t5/arcgis-web-appbuilder-questions/how-can-i-toggle-the-visibility-of-a-widget/m-p/535297#M14078</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I currently have a few widgets in my config.json file that I would like to start out as not visible, so I am setting the "visible" property to false. I have another widget that will be sending a request and depending on the response from the request, I want to turn on the visibility of some of the widgets. This is what I currently have:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;SPAN style="color: #cc7832; font-weight: bold;"&gt;var &lt;/SPAN&gt;widgetManager = WidgetManager.&lt;SPAN style="color: #ffc66d;"&gt;getInstance&lt;/SPAN&gt;()&lt;SPAN style="color: #cc7832;"&gt;;&lt;/SPAN&gt;
widgetManager.&lt;SPAN style="color: #9876aa;"&gt;appConfig&lt;/SPAN&gt;.&lt;SPAN style="color: #9876aa;"&gt;widgetOnScreen&lt;/SPAN&gt;.&lt;SPAN style="color: #9876aa;"&gt;widgets&lt;/SPAN&gt;[&lt;SPAN style="color: #6897bb;"&gt;6&lt;/SPAN&gt;].&lt;SPAN style="color: #9876aa;"&gt;visible &lt;/SPAN&gt;= &lt;SPAN style="color: #cc7832; font-weight: bold;"&gt;true&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;;&lt;/SPAN&gt;
&lt;SPAN style="color: #cc7832;"&gt;widgetManager.&lt;SPAN style="color: #ffc66d;"&gt;loadWidget&lt;/SPAN&gt;(widgetManager.&lt;SPAN style="color: #9876aa;"&gt;appConfig&lt;/SPAN&gt;.&lt;SPAN style="color: #9876aa;"&gt;widgetOnScreen&lt;/SPAN&gt;.&lt;SPAN style="color: #9876aa;"&gt;widgets&lt;/SPAN&gt;[&lt;SPAN style="color: #6897bb;"&gt;6&lt;/SPAN&gt;]).&lt;SPAN style="color: #9876aa;"&gt;then&lt;/SPAN&gt;(lang.&lt;SPAN style="color: #ffc66d;"&gt;hitch&lt;/SPAN&gt;(&lt;SPAN style="color: #cc7832; font-weight: bold;"&gt;this&lt;/SPAN&gt;&lt;SPAN style="color: #cc7832;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: #cc7832; font-weight: bold;"&gt;function&lt;/SPAN&gt;(widget){&lt;/SPAN&gt;
&lt;SPAN style="color: #cc7832;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&lt;/SPAN&gt;
&lt;SPAN style="color: #cc7832;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; console.log(widget);&lt;/SPAN&gt;
&lt;SPAN style="color: #cc7832;"&gt;}));&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The console log I have shows that the visible property is set to true (widget { visible:true }), but the widget is not visible in the application. Can anyone help with this? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks, &lt;BR /&gt;Jamie&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 23:15:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-web-appbuilder-questions/how-can-i-toggle-the-visibility-of-a-widget/m-p/535297#M14078</guid>
      <dc:creator>JamieThompson2</dc:creator>
      <dc:date>2021-12-11T23:15:30Z</dc:date>
    </item>
    <item>
      <title>Re: How can I toggle the visibility of a widget?</title>
      <link>https://community.esri.com/t5/arcgis-web-appbuilder-questions/how-can-i-toggle-the-visibility-of-a-widget/m-p/535298#M14079</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;Jamie,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt; You will have to use the PanelManager and showPanel function. Here is a thread that details the code needed:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;&lt;A href="https://community.esri.com/thread/131834"&gt;Load In-Panel Widget onStart of the application&lt;/A&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 27 Mar 2016 05:02:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-web-appbuilder-questions/how-can-i-toggle-the-visibility-of-a-widget/m-p/535298#M14079</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2016-03-27T05:02:40Z</dc:date>
    </item>
    <item>
      <title>Re: How can I toggle the visibility of a widget?</title>
      <link>https://community.esri.com/t5/arcgis-web-appbuilder-questions/how-can-i-toggle-the-visibility-of-a-widget/m-p/535299#M14080</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Robert, &lt;/P&gt;&lt;P&gt;Thank you! this was helpful. I am currently able to add onScreen widgets, but I'm having difficulties adding widgets into the widget pool &amp;amp; having them show up. The user is first prompted with a login widget - which will return widgets the user is allowed to view. After that I use can successfully create the widgets, but I am having issues adding them to the Header Controller (top panel of the Foldable Theme). Would you happen to know anything about how to do this or if it might simply be one of the limitations of the WAB? I've tried a few different things but nothing seems to work, but it seems like something that others would have probably tried to do already.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Mar 2016 21:05:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-web-appbuilder-questions/how-can-i-toggle-the-visibility-of-a-widget/m-p/535299#M14080</guid>
      <dc:creator>JamieThompson2</dc:creator>
      <dc:date>2016-03-30T21:05:46Z</dc:date>
    </item>
    <item>
      <title>Re: How can I toggle the visibility of a widget?</title>
      <link>https://community.esri.com/t5/arcgis-web-appbuilder-questions/how-can-i-toggle-the-visibility-of-a-widget/m-p/535300#M14081</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Jamie,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; Sure thing here is some code for that:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;//utility function to get the proper widget config based on the widget name !Not Label but Name!
_getWidgetConfig: function(widgetName){
&amp;nbsp; var widgetCnfg = null;
&amp;nbsp; array.some(this.wManager.appConfig.widgetPool.widgets, function(aWidget) {
&amp;nbsp;&amp;nbsp;&amp;nbsp; if(aWidget.name == widgetName) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; widgetCnfg = aWidget;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return true;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp;&amp;nbsp; return false;
&amp;nbsp; });
&amp;nbsp; if(!widgetCnfg){
&amp;nbsp;&amp;nbsp;&amp;nbsp; /*Check OnScreen widgets if not found in widgetPool*/
&amp;nbsp;&amp;nbsp;&amp;nbsp; array.some(this.wManager.appConfig.widgetOnScreen.widgets, function(aWidget) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(aWidget.name == widgetName) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; widgetCnfg = aWidget;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return true;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return false;
&amp;nbsp;&amp;nbsp;&amp;nbsp; });
&amp;nbsp; }
&amp;nbsp; return widgetCnfg;
},
//call utility function to get the proper widget config based on the widget name !Not Label but Name!
//The label can be changed by the widget configurer
var widgetCfg = this._getWidgetConfig('Legend');
widgetCfg.visible = true;
var headerCfg = this._getWidgetConfig('HeaderController');
var headerWidget = this.wManager.getWidgetByLabel(headerCfg.label);
//This is need to show the widgets icon in the header
headerWidget.resize();
//This actually open the widget
headerWidget.setOpenedIds([widgetCfg.id]);&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 23:15:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-web-appbuilder-questions/how-can-i-toggle-the-visibility-of-a-widget/m-p/535300#M14081</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2021-12-11T23:15:32Z</dc:date>
    </item>
    <item>
      <title>Re: How can I toggle the visibility of a widget?</title>
      <link>https://community.esri.com/t5/arcgis-web-appbuilder-questions/how-can-i-toggle-the-visibility-of-a-widget/m-p/535301#M14082</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Wow thank you! I had spent a majority of yesterday trying different things, this will help me save so much time. I really appreciate it! &lt;IMG src="https://community.esri.com/legacyfs/online/emoticons/happy.png" /&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;IMG alt="happyDance.jpg" class="image-1 jive-image" height="262" src="https://community.esri.com/legacyfs/online/193507_happyDance.jpg" style="width: 262px; height: 262px;" width="262" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 Mar 2016 14:01:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-web-appbuilder-questions/how-can-i-toggle-the-visibility-of-a-widget/m-p/535301#M14082</guid>
      <dc:creator>JamieThompson2</dc:creator>
      <dc:date>2016-03-31T14:01:21Z</dc:date>
    </item>
    <item>
      <title>Re: How can I toggle the visibility of a widget?</title>
      <link>https://community.esri.com/t5/arcgis-web-appbuilder-questions/how-can-i-toggle-the-visibility-of-a-widget/m-p/535302#M14083</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Jamie,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; Please mark this thread as answered by click on the "Correct Answer" link on the reply that answered your question.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 May 2016 19:04:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-web-appbuilder-questions/how-can-i-toggle-the-visibility-of-a-widget/m-p/535302#M14083</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2016-05-25T19:04:17Z</dc:date>
    </item>
    <item>
      <title>Re: How can I toggle the visibility of a widget?</title>
      <link>https://community.esri.com/t5/arcgis-web-appbuilder-questions/how-can-i-toggle-the-visibility-of-a-widget/m-p/535303#M14084</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jamie, I tried Robert's codes, and it worked for Foldable Theme, but didn't work for Launchpad theme even i have changed the "HeaderController" to "AnchorBarController". Did they work for you?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Dec 2016 15:50:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-web-appbuilder-questions/how-can-i-toggle-the-visibility-of-a-widget/m-p/535303#M14084</guid>
      <dc:creator>Alexwang</dc:creator>
      <dc:date>2016-12-20T15:50:52Z</dc:date>
    </item>
    <item>
      <title>Re: How can I toggle the visibility of a widget?</title>
      <link>https://community.esri.com/t5/arcgis-web-appbuilder-questions/how-can-i-toggle-the-visibility-of-a-widget/m-p/535304#M14085</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Alex,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I only used the Foldable theme, so I'm not sure.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Dec 2016 15:55:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-web-appbuilder-questions/how-can-i-toggle-the-visibility-of-a-widget/m-p/535304#M14085</guid>
      <dc:creator>JamieThompson2</dc:creator>
      <dc:date>2016-12-20T15:55:20Z</dc:date>
    </item>
    <item>
      <title>Re: How can I toggle the visibility of a widget?</title>
      <link>https://community.esri.com/t5/arcgis-web-appbuilder-questions/how-can-i-toggle-the-visibility-of-a-widget/m-p/535305#M14086</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;please see Roberts' another post -&amp;nbsp;&lt;A _jive_internal="true" class="link-titled" href="https://community.esri.com/message/654968-re-showhide-widgets-on-the-fly?commentID=654968&amp;amp;et=watches.email.thread#comment-654968" title="https://community.esri.com/message/654968-re-showhide-widgets-on-the-fly?commentID=654968&amp;amp;et=watches.email.thread#comment-654968"&gt;https://community.esri.com/message/654968-re-showhide-widgets-on-the-fly?commentID=654968&amp;amp;et=watches.email.thread#comment-6…&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Dec 2016 16:31:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-web-appbuilder-questions/how-can-i-toggle-the-visibility-of-a-widget/m-p/535305#M14086</guid>
      <dc:creator>Alexwang</dc:creator>
      <dc:date>2016-12-20T16:31:23Z</dc:date>
    </item>
  </channel>
</rss>

