<?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: Listen for on-create feature event in Web AppBuilder Custom Widgets Questions</title>
    <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/listen-for-on-create-feature-event/m-p/778854#M2340</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;River Taig,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; Looks good to me.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 09 Feb 2015 18:30:09 GMT</pubDate>
    <dc:creator>RobertScheitlin__GISP</dc:creator>
    <dc:date>2015-02-09T18:30:09Z</dc:date>
    <item>
      <title>Listen for on-create feature event</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/listen-for-on-create-feature-event/m-p/778851#M2337</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm trying to figure out how to listen for the on-create feature event.&amp;nbsp; I'm working with the Editor widget, but it doesn't seem to expose any events. Now the attribute editor (which I can get from the editor using the code below) &lt;SPAN style="text-decoration: underline;"&gt;&lt;EM&gt;does&lt;/EM&gt;&lt;/SPAN&gt; expose events, but sadly not the one I'm looking for.&amp;nbsp; The following code works great to get the attribute changes, but how do I get those new features?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;var attInspector = this.editor.attributeInspector;&lt;/P&gt;&lt;P&gt;alert("attInspector = " + attInspector);&lt;/P&gt;&lt;P&gt;attInspector.on("attribute-change", function(evt) {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; alert("Attribute changed");&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; feature = evt.feature;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; //more code follows...&lt;/P&gt;&lt;P&gt;});&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Feb 2015 17:02:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/listen-for-on-create-feature-event/m-p/778851#M2337</guid>
      <dc:creator>RiverTaig1</dc:creator>
      <dc:date>2015-02-09T17:02:02Z</dc:date>
    </item>
    <item>
      <title>Re: Listen for on-create feature event</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/listen-for-on-create-feature-event/m-p/778852#M2338</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;River Taig,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; The event you should be listening for is the events from the actual FeatureLayer. The FeatureLayer has a before-apply-edits event that you can hook into that should work for you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://developers.arcgis.com/javascript/jsapi/featurelayer-amd.html#event-before-apply-edits" title="https://developers.arcgis.com/javascript/jsapi/featurelayer-amd.html#event-before-apply-edits"&gt;https://developers.arcgis.com/javascript/jsapi/featurelayer-amd.html#event-before-apply-edits&lt;/A&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Feb 2015 17:31:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/listen-for-on-create-feature-event/m-p/778852#M2338</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2015-02-09T17:31:35Z</dc:date>
    </item>
    <item>
      <title>Re: Listen for on-create feature event</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/listen-for-on-create-feature-event/m-p/778853#M2339</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you Robert.&amp;nbsp; I ended up listening for edits-complete doing something like this: Please let me know if this looks crazy wrong (seems to work though)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;function setUpListener(map) {&lt;/P&gt;&lt;P&gt;&amp;nbsp; featureLayerCount = map.graphicsLayerIds.length;&lt;/P&gt;&lt;P&gt;&amp;nbsp; for(i = 0; i &amp;lt; featureLayerCount; i++){&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var layerID = map.graphicsLayerIds&lt;I&gt;;&lt;/I&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var fLayer = map.getLayer(layerID);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(fLayer !== undefined)&amp;nbsp; {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; fLayer.on("edits-complete", OnEditsCompleteHandler);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;function OnEditsCompleteHandler(evt){&lt;/P&gt;&lt;P&gt;&amp;nbsp; alert("it worked!&amp;nbsp; Here's the data: " + evt);&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Feb 2015 18:25:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/listen-for-on-create-feature-event/m-p/778853#M2339</guid>
      <dc:creator>RiverTaig1</dc:creator>
      <dc:date>2015-02-09T18:25:33Z</dc:date>
    </item>
    <item>
      <title>Re: Listen for on-create feature event</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/listen-for-on-create-feature-event/m-p/778854#M2340</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;River Taig,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; Looks good to me.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Feb 2015 18:30:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/listen-for-on-create-feature-event/m-p/778854#M2340</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2015-02-09T18:30:09Z</dc:date>
    </item>
  </channel>
</rss>

