<?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 What is the right way to extend/modify a popup in WebAppBuilder 2.0? in ArcGIS Web AppBuilder Questions</title>
    <link>https://community.esri.com/t5/arcgis-web-appbuilder-questions/what-is-the-right-way-to-extend-modify-a-popup-in/m-p/45459#M1223</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In version 1.x of WebAppBuilder popups seemed to be handled by the AttributeTable\Widget.js code, and by adding a little bit of code to the jimu/InfoWindowAction section of that Widget.js file we were able to execute a little bit of JavaScript code after a popup had been rendered to enhance and improve aspects of the popup. It was a bit of a hack, but it worked - happy to share more details if anyone's interested. &lt;/P&gt;&lt;P&gt;In version 2.0 of WebAppBuilder, though, it appears as if all of the popup rendering is performed using code from the JavaScript API - js.arcgis.com, specifically esri/dijit/PopupRenderer - so our hack won't work unless we were to pull that code locally, and we'd really prefer not to do that. Instead we're trying to do things the right way - by using Dojo Inheritance to extend the PopupRenderer class.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;A href="https://dojotoolkit.org/reference-guide/1.10/dojo/_base/declare.html#extend" title="https://dojotoolkit.org/reference-guide/1.10/dojo/_base/declare.html#extend" rel="nofollow noopener noreferrer" target="_blank"&gt;dojo/_base/declare — The Dojo Toolkit - Reference Guide&lt;/A&gt; &lt;/P&gt;&lt;P&gt;We know that any extension has to occur after the API has been loaded, so we're working within the dynamic-modules/postload.js file, which does seem to be executed at the right time.&amp;nbsp; Our very simple code block is here:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;define(['esri/dijit/PopupRenderer'],
function(popupRenderer){
&amp;nbsp;&amp;nbsp;&amp;nbsp; return popupRenderer.extend({
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _handleComponentsSuccess: function(){
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; this.inherited(arguments);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; console.log("success");
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp;&amp;nbsp; });
});&lt;/PRE&gt;&lt;P&gt;According to our understanding, this inherits the existing PopupRenderer class, it then returns an extended version of that class with an altered _handleComponentsSuccess function, and this.inherited(arguments); is the technique to use to call the superclass method (so we don't overwrite it). In practice, everything about this code works except for that calling of the superclass method - a "success" is logged to the console every time a popup is supposed to be rendered, but the internal content of the popup is never populated - the original _handleComponentsSuccess code is never executed (We've tried extending the .startup function as well).&amp;nbsp; So what are we missing?&amp;nbsp; Is there a different way to extent esri dijits? Or are we misunderstanding the concept of Dojo inheritance? Or is WebAppBuilder just a different ballgame? If we can get this right, it seems like it should be a really elegant way to perform small enhancements.&amp;nbsp; Thanks in advance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 10 Dec 2021 21:46:13 GMT</pubDate>
    <dc:creator>TorrinHultgren</dc:creator>
    <dc:date>2021-12-10T21:46:13Z</dc:date>
    <item>
      <title>What is the right way to extend/modify a popup in WebAppBuilder 2.0?</title>
      <link>https://community.esri.com/t5/arcgis-web-appbuilder-questions/what-is-the-right-way-to-extend-modify-a-popup-in/m-p/45459#M1223</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In version 1.x of WebAppBuilder popups seemed to be handled by the AttributeTable\Widget.js code, and by adding a little bit of code to the jimu/InfoWindowAction section of that Widget.js file we were able to execute a little bit of JavaScript code after a popup had been rendered to enhance and improve aspects of the popup. It was a bit of a hack, but it worked - happy to share more details if anyone's interested. &lt;/P&gt;&lt;P&gt;In version 2.0 of WebAppBuilder, though, it appears as if all of the popup rendering is performed using code from the JavaScript API - js.arcgis.com, specifically esri/dijit/PopupRenderer - so our hack won't work unless we were to pull that code locally, and we'd really prefer not to do that. Instead we're trying to do things the right way - by using Dojo Inheritance to extend the PopupRenderer class.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;A href="https://dojotoolkit.org/reference-guide/1.10/dojo/_base/declare.html#extend" title="https://dojotoolkit.org/reference-guide/1.10/dojo/_base/declare.html#extend" rel="nofollow noopener noreferrer" target="_blank"&gt;dojo/_base/declare — The Dojo Toolkit - Reference Guide&lt;/A&gt; &lt;/P&gt;&lt;P&gt;We know that any extension has to occur after the API has been loaded, so we're working within the dynamic-modules/postload.js file, which does seem to be executed at the right time.&amp;nbsp; Our very simple code block is here:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;define(['esri/dijit/PopupRenderer'],
function(popupRenderer){
&amp;nbsp;&amp;nbsp;&amp;nbsp; return popupRenderer.extend({
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _handleComponentsSuccess: function(){
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; this.inherited(arguments);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; console.log("success");
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp;&amp;nbsp; });
});&lt;/PRE&gt;&lt;P&gt;According to our understanding, this inherits the existing PopupRenderer class, it then returns an extended version of that class with an altered _handleComponentsSuccess function, and this.inherited(arguments); is the technique to use to call the superclass method (so we don't overwrite it). In practice, everything about this code works except for that calling of the superclass method - a "success" is logged to the console every time a popup is supposed to be rendered, but the internal content of the popup is never populated - the original _handleComponentsSuccess code is never executed (We've tried extending the .startup function as well).&amp;nbsp; So what are we missing?&amp;nbsp; Is there a different way to extent esri dijits? Or are we misunderstanding the concept of Dojo inheritance? Or is WebAppBuilder just a different ballgame? If we can get this right, it seems like it should be a really elegant way to perform small enhancements.&amp;nbsp; Thanks in advance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 21:46:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-web-appbuilder-questions/what-is-the-right-way-to-extend-modify-a-popup-in/m-p/45459#M1223</guid>
      <dc:creator>TorrinHultgren</dc:creator>
      <dc:date>2021-12-10T21:46:13Z</dc:date>
    </item>
    <item>
      <title>Re: What is the right way to extend/modify a popup in WebAppBuilder 2.0?</title>
      <link>https://community.esri.com/t5/arcgis-web-appbuilder-questions/what-is-the-right-way-to-extend-modify-a-popup-in/m-p/45460#M1224</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Torrin,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; In WAB 2.0 there is a PopupManager.js and the custom popup actions are in the PopupActions folder. Both are in the jimu folder.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 May 2016 01:25:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-web-appbuilder-questions/what-is-the-right-way-to-extend-modify-a-popup-in/m-p/45460#M1224</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2016-05-19T01:25:59Z</dc:date>
    </item>
    <item>
      <title>Re: What is the right way to extend/modify a popup in WebAppBuilder 2.0?</title>
      <link>https://community.esri.com/t5/arcgis-web-appbuilder-questions/what-is-the-right-way-to-extend-modify-a-popup-in/m-p/45461#M1225</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hrm, we started there, but were puzzled when that code (jimu/PopupActions/PopupActions.js) never appeared to be required and/or executed. In revisiting this path, though, we did find that jimu/PopupActions/PopupAction is also defined within jimu/main.js, and we were able to re-implement our version 1.0 hack by augmenting the _onSelectionChange method there. So I guess our practical problem is solved, but we're still curious about why the more elegant and versatile dojo .extend inheritance solution doesn't work. &lt;/P&gt;&lt;P&gt;Much appreciated, Robert.&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 May 2016 18:40:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-web-appbuilder-questions/what-is-the-right-way-to-extend-modify-a-popup-in/m-p/45461#M1225</guid>
      <dc:creator>TorrinHultgren</dc:creator>
      <dc:date>2016-05-19T18:40:04Z</dc:date>
    </item>
    <item>
      <title>Re: What is the right way to extend/modify a popup in WebAppBuilder 2.0?</title>
      <link>https://community.esri.com/t5/arcgis-web-appbuilder-questions/what-is-the-right-way-to-extend-modify-a-popup-in/m-p/45462#M1226</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;A href="https://community.esri.com/migrated-users/3101"&gt;Robert Scheitlin, GISP&lt;/A&gt;​ have you have some more detailed information about this class (PopUpManager.js)? Is it possible, in example, display related data from a relationship class within the custom pop-up ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I know the AttributeTableWidget can show this information but It doesn't looks as good as if it is self-contained within the pop-up window.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards&lt;/P&gt;&lt;P&gt;Ezequias Rocha&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Jun 2016 01:28:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-web-appbuilder-questions/what-is-the-right-way-to-extend-modify-a-popup-in/m-p/45462#M1226</guid>
      <dc:creator>deleted-user-0W0-oLHxDjCX</dc:creator>
      <dc:date>2016-06-01T01:28:13Z</dc:date>
    </item>
    <item>
      <title>Re: What is the right way to extend/modify a popup in WebAppBuilder 2.0?</title>
      <link>https://community.esri.com/t5/arcgis-web-appbuilder-questions/what-is-the-right-way-to-extend-modify-a-popup-in/m-p/45463#M1227</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ezequias,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; I don not work much with related data. But you should look at the RelatedRecordAction.js in the jimu.js\PopupActions folder. It looks like you should get a related records actioin button in the popup if the feature does have some related records.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Jun 2016 02:46:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-web-appbuilder-questions/what-is-the-right-way-to-extend-modify-a-popup-in/m-p/45463#M1227</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2016-06-01T02:46:24Z</dc:date>
    </item>
  </channel>
</rss>

