<?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: Close/destroy  widget A from widget B on clear button in ArcGIS Web AppBuilder Questions</title>
    <link>https://community.esri.com/t5/arcgis-web-appbuilder-questions/close-destroy-widget-a-from-widget-b-on-clear/m-p/1207673#M22468</link>
    <description>&lt;P&gt;Hi Robert, widget B is an onScreen widget and widget B icon shouldn't&amp;nbsp; be visible in application but it has to open while sending data to widget b from widget A.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 30 Aug 2022 14:00:42 GMT</pubDate>
    <dc:creator>naveenbesri</dc:creator>
    <dc:date>2022-08-30T14:00:42Z</dc:date>
    <item>
      <title>Close/destroy  widget A from widget B on clear button</title>
      <link>https://community.esri.com/t5/arcgis-web-appbuilder-questions/close-destroy-widget-a-from-widget-b-on-clear/m-p/1206378#M22455</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;as per our requirement we will be performing some operations in both widget A and widget B.&lt;/P&gt;&lt;P&gt;after that when we click on clear button in widget B then widget A needs to close and get destroy so that performed operations on widget A needs to get cleared.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Kindly do the needful&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 25 Aug 2022 16:03:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-web-appbuilder-questions/close-destroy-widget-a-from-widget-b-on-clear/m-p/1206378#M22455</guid>
      <dc:creator>naveenbesri</dc:creator>
      <dc:date>2022-08-25T16:03:12Z</dc:date>
    </item>
    <item>
      <title>Re: Close/destroy  widget A from widget B on clear button</title>
      <link>https://community.esri.com/t5/arcgis-web-appbuilder-questions/close-destroy-widget-a-from-widget-b-on-clear/m-p/1206422#M22456</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/1104"&gt;@RobertScheitlin__GISP&lt;/a&gt;&amp;nbsp;&amp;nbsp;sorry to bother you. Kindly help me out on this if you do got any idea ?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 25 Aug 2022 17:11:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-web-appbuilder-questions/close-destroy-widget-a-from-widget-b-on-clear/m-p/1206422#M22456</guid>
      <dc:creator>naveenbesri</dc:creator>
      <dc:date>2022-08-25T17:11:31Z</dc:date>
    </item>
    <item>
      <title>Re: Close/destroy  widget A from widget B on clear button</title>
      <link>https://community.esri.com/t5/arcgis-web-appbuilder-questions/close-destroy-widget-a-from-widget-b-on-clear/m-p/1206707#M22459</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/162655"&gt;@naveenbesri&lt;/a&gt;&amp;nbsp;You can close a widget using this line of code.&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;this.props.dispatch(appActions.closeWidget("the ID of the widget you want to close"));&lt;/LI-CODE&gt;&lt;P&gt;Not sure about how to destroy a widget or why you would want to verses just close the widget. In widget widget A you can add some code to componentDidUpdate to do any clean up of things you did in widget A, like outlined in this thread.&amp;nbsp;&lt;A href="https://community.esri.com/t5/arcgis-experience-builder-questions/widget-close-event/m-p/1040201#M1659" target="_blank"&gt;https://community.esri.com/t5/arcgis-experience-builder-questions/widget-close-event/m-p/1040201#M1659&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 26 Aug 2022 12:46:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-web-appbuilder-questions/close-destroy-widget-a-from-widget-b-on-clear/m-p/1206707#M22459</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2022-08-26T12:46:59Z</dc:date>
    </item>
    <item>
      <title>Re: Close/destroy  widget A from widget B on clear button</title>
      <link>https://community.esri.com/t5/arcgis-web-appbuilder-questions/close-destroy-widget-a-from-widget-b-on-clear/m-p/1207115#M22462</link>
      <description>&lt;P&gt;Thanks &lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/1104"&gt;@RobertScheitlin__GISP&lt;/a&gt;&amp;nbsp;Robert&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":smiling_face_with_smiling_eyes:"&gt;😊&lt;/span&gt;&amp;nbsp; But&amp;nbsp; I am try to refer to&amp;nbsp; WAB not in experience builder. I achieved this by publishdata passing some clearmessage to widget B. while clicking on clear button in widget A on receive data in widget B will receive my message placed if condition and closing&amp;nbsp; my widget B using panelmanager.closepanel().&amp;nbsp;&lt;/P&gt;&lt;P&gt;can we hide widget B in WAB application ? and whenever widget A publish data(widget communication) then widget B needs to open and show the data. please help me on this.&lt;/P&gt;</description>
      <pubDate>Mon, 29 Aug 2022 14:59:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-web-appbuilder-questions/close-destroy-widget-a-from-widget-b-on-clear/m-p/1207115#M22462</guid>
      <dc:creator>naveenbesri</dc:creator>
      <dc:date>2022-08-29T14:59:33Z</dc:date>
    </item>
    <item>
      <title>Re: Close/destroy  widget A from widget B on clear button</title>
      <link>https://community.esri.com/t5/arcgis-web-appbuilder-questions/close-destroy-widget-a-from-widget-b-on-clear/m-p/1207634#M22466</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/162655"&gt;@naveenbesri&lt;/a&gt;&amp;nbsp;Sorry I forgot to check which forum I was in. Is widget B an onScreenWidget or is it part of the HeaderControllers' widgets? The answer to that will make all the difference in the code that I will share.&lt;/P&gt;</description>
      <pubDate>Tue, 30 Aug 2022 12:32:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-web-appbuilder-questions/close-destroy-widget-a-from-widget-b-on-clear/m-p/1207634#M22466</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2022-08-30T12:32:47Z</dc:date>
    </item>
    <item>
      <title>Re: Close/destroy  widget A from widget B on clear button</title>
      <link>https://community.esri.com/t5/arcgis-web-appbuilder-questions/close-destroy-widget-a-from-widget-b-on-clear/m-p/1207673#M22468</link>
      <description>&lt;P&gt;Hi Robert, widget B is an onScreen widget and widget B icon shouldn't&amp;nbsp; be visible in application but it has to open while sending data to widget b from widget A.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 30 Aug 2022 14:00:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-web-appbuilder-questions/close-destroy-widget-a-from-widget-b-on-clear/m-p/1207673#M22468</guid>
      <dc:creator>naveenbesri</dc:creator>
      <dc:date>2022-08-30T14:00:42Z</dc:date>
    </item>
    <item>
      <title>Re: Close/destroy  widget A from widget B on clear button</title>
      <link>https://community.esri.com/t5/arcgis-web-appbuilder-questions/close-destroy-widget-a-from-widget-b-on-clear/m-p/1207831#M22469</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/162655"&gt;@naveenbesri&lt;/a&gt;&amp;nbsp; So for the onScreen widget placeholder to not be visible but be loaded and listening for another widget that is pretty simple. In the aps main config.json just search for the widgets name and make the widgets position left attribute a large negative number.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;"position": {
  "left": -550,
...&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 30 Aug 2022 17:59:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-web-appbuilder-questions/close-destroy-widget-a-from-widget-b-on-clear/m-p/1207831#M22469</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2022-08-30T17:59:07Z</dc:date>
    </item>
    <item>
      <title>Re: Close/destroy  widget A from widget B on clear button</title>
      <link>https://community.esri.com/t5/arcgis-web-appbuilder-questions/close-destroy-widget-a-from-widget-b-on-clear/m-p/1208264#M22472</link>
      <description>&lt;P&gt;Thank you Robert it worked and able to open widget B from widget A but widget B is going out of map on open how to get widget open in&amp;nbsp; center of the map. plz help me&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="naveenbesri_0-1661961547551.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/50001i0691EC21E4E017FE/image-size/medium?v=v2&amp;amp;px=400" role="button" title="naveenbesri_0-1661961547551.png" alt="naveenbesri_0-1661961547551.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 31 Aug 2022 16:03:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-web-appbuilder-questions/close-destroy-widget-a-from-widget-b-on-clear/m-p/1208264#M22472</guid>
      <dc:creator>naveenbesri</dc:creator>
      <dc:date>2022-08-31T16:03:27Z</dc:date>
    </item>
    <item>
      <title>Re: Close/destroy  widget A from widget B on clear button</title>
      <link>https://community.esri.com/t5/arcgis-web-appbuilder-questions/close-destroy-widget-a-from-widget-b-on-clear/m-p/1208335#M22473</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/162655"&gt;@naveenbesri&lt;/a&gt;&amp;nbsp;Here is some code I use to open an off screen widget.&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;define([
...
'jimu/WidgetManager',
    'jimu/PanelManager',
    'dojo/_base/array',
  ],
function (
...
WidgetManager, PanelManager, array
  ) {
...

postCreate: function () {
...
this.wManager = WidgetManager.getInstance();
        this.pManager = PanelManager.getInstance();
      },

_openAboutWidget: function () {
        if (this.wManager) {
          var widgetCfg = this._getWidgetConfig('About');
          if (widgetCfg) {
            var aboutWidget = this.wManager.getWidgetByLabel(widgetCfg.label);
            if (aboutWidget) {
              this.wManager.openWidget(aboutWidget);
              this.pManager.showPanel(aboutWidget);
            } else {
              this.wManager.loadWidget(widgetCfg).then(lang.hitch(this, function (widget) {
                if (widget) {
                  this.wManager.openWidget(widget);
                  this.pManager.showPanel(widgetCfg).then(lang.hitch(this, function (panel) {
//Move the widgets position back to on screen
                    panel.setPosition({
                      top: 45,
                      left: 55
                    });
                    this.pManager.normalizePanel(panel);
                  }))
                }
              }));
            }
          }
        }
      },

      _getWidgetConfig: function(widgetName) {
        var widgetCnfg = null;
        array.some(this.wManager.appConfig.widgetPool.widgets, function(aWidget) {
          if(aWidget.name == widgetName) {
            widgetCnfg = aWidget;
            return true;
          }
          return false;
        });
        if(!widgetCnfg) {
          /*Check OnScreen widgets if not found in widgetPool*/
          array.some(this.wManager.appConfig.widgetOnScreen.widgets, function(aWidget) {
            if(aWidget.name == widgetName) {
              widgetCnfg = aWidget;
              return true;
            }
            return false;
          });
        }
        if(!widgetCnfg) {
          /*Check OnScreen groups widgets if not found in OnScreen widgets*/
          array.map(this.wManager.appConfig.widgetOnScreen.groups, function(aGroup) {
            array.some(aGroup.widgets, function(aWidget) {
              if(aWidget.name == widgetName) {
                widgetCnfg = aWidget;
                return true;
              }
              return false;
            });
          });
        }
        return widgetCnfg;
      },&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 31 Aug 2022 17:48:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-web-appbuilder-questions/close-destroy-widget-a-from-widget-b-on-clear/m-p/1208335#M22473</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2022-08-31T17:48:16Z</dc:date>
    </item>
  </channel>
</rss>

