<?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: UndoManager change event listener in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/undomanager-change-event-listener/m-p/71255#M6328</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the responses.&amp;nbsp; I was just thinking I might have been missing something obvious since the docs seem to imply that the class supports the "on" style, but I think you're all right.&amp;nbsp; I'll just stick with the "connect" pattern for now.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 13 Aug 2014 01:46:26 GMT</pubDate>
    <dc:creator>MattCooper</dc:creator>
    <dc:date>2014-08-13T01:46:26Z</dc:date>
    <item>
      <title>UndoManager change event listener</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/undomanager-change-event-listener/m-p/71252#M6325</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm not having any luck setting up the event listener for the UndoManager unless I use the "connect" style instead of the "on" style.&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;PRE __default_attr="javascript" __jive_macro_name="code" class="jive_macro_code jive_text_macro _jivemacro_uid_14078751738101877" jivemacro_uid="_14078751738101877" modifiedtitle="true"&gt;
&lt;P&gt;&lt;SPAN class="s1"&gt;var&lt;/SPAN&gt; undoManager = &lt;SPAN class="s1"&gt;new&lt;/SPAN&gt; UndoManager();&lt;/P&gt;
&lt;P&gt;undoManager.on(&lt;SPAN class="s2"&gt;"change"&lt;/SPAN&gt;, checkUndoRedoState); //this throws an error&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="color: rgba(0, 0, 0, 0); font-family: Consolas, 'Courier New', Courier, mono, serif; font-size: 12px;"&gt;connect.connect(undoManager, "onChange", checkUndoRedoState); //this works fine&lt;/SPAN&gt;&lt;/P&gt;
&lt;/PRE&gt;&lt;P class="p1"&gt;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s3"&gt;Any ideas what I'm missing? &lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s3"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s3"&gt;Thanks,&lt;/SPAN&gt;&lt;SPAN class="s3"&gt;Matt&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Aug 2014 22:19:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/undomanager-change-event-listener/m-p/71252#M6325</guid>
      <dc:creator>MattCooper</dc:creator>
      <dc:date>2014-08-12T22:19:37Z</dc:date>
    </item>
    <item>
      <title>Re: UndoManager change event listener</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/undomanager-change-event-listener/m-p/71253#M6326</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I noticed that the ESRI sample for the Undo Manager uses the old connect style:&lt;/P&gt;&lt;P&gt;&lt;A href="https://developers.arcgis.com/javascript/jssamples/graphics_undoredo.html" title="https://developers.arcgis.com/javascript/jssamples/graphics_undoredo.html"&gt;Graphics with undo redo | ArcGIS API for JavaScript&lt;/A&gt;‌&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After changing this sample to use the 'on' style event I also get an error. Adding some console.log lines shows the following:&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="3398" alt="undomanager.png" class="jive-image image-1" src="https://community.esri.com/legacyfs/online/3398_undomanager.png" style="width: 620px; height: 64px;" /&gt;&lt;/P&gt;&lt;P&gt;The 'on' function of the undo manager is undefined. Other 'on' functions are fine (such as the map.on above).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Interestingly, using the alternate dojo.on style gives another message, for example the following results:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="javascript" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_14078858711306192 jive_text_macro" jivemacro_uid="_14078858711306192"&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; on(map, "load", function () {&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; console.log("on-map-load");&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; });&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; // console: &lt;SPAN style="color: #222222; font-family: Consolas, 'Lucida Console', monospace; font-size: 12px;"&gt;on-map-load&lt;/SPAN&gt;&lt;SPAN style="color: #222222; font-family: Consolas, 'Lucida Console', monospace; font-size: 12px;"&gt; &lt;/SPAN&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; on(undoManager, "change", checkUndoRedoState);&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; // &lt;SPAN style="color: #ff0000; font-family: Consolas, 'Lucida Console', monospace; font-size: 12px;"&gt;Uncaught Error: Target must be an event emitter&lt;/SPAN&gt;&lt;SPAN style="color: #ff0000; font-family: Consolas, 'Lucida Console', monospace; font-size: 12px;"&gt; &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;

&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Not sure if this is a bug.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Owen&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.spatialxp.com.au/"&gt;Spatial XP&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Aug 2014 23:30:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/undomanager-change-event-listener/m-p/71253#M6326</guid>
      <dc:creator>OwenEarley</dc:creator>
      <dc:date>2014-08-12T23:30:08Z</dc:date>
    </item>
    <item>
      <title>Re: UndoManager change event listener</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/undomanager-change-event-listener/m-p/71254#M6327</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;My guess is that the UndoManager class does not inherit from 'Evented' (see &lt;A href="http://dojotoolkit.org/reference-guide/1.10/dojo/Evented.html" title="http://dojotoolkit.org/reference-guide/1.10/dojo/Evented.html"&gt;dojo/Evented&lt;/A&gt;).&amp;nbsp; Until that happens you'll have to use the 'connect' pattern which, as you mention above, works just fine.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Aug 2014 23:47:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/undomanager-change-event-listener/m-p/71254#M6327</guid>
      <dc:creator>JohnGrayson</dc:creator>
      <dc:date>2014-08-12T23:47:27Z</dc:date>
    </item>
    <item>
      <title>Re: UndoManager change event listener</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/undomanager-change-event-listener/m-p/71255#M6328</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the responses.&amp;nbsp; I was just thinking I might have been missing something obvious since the docs seem to imply that the class supports the "on" style, but I think you're all right.&amp;nbsp; I'll just stick with the "connect" pattern for now.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Aug 2014 01:46:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/undomanager-change-event-listener/m-p/71255#M6328</guid>
      <dc:creator>MattCooper</dc:creator>
      <dc:date>2014-08-13T01:46:26Z</dc:date>
    </item>
    <item>
      <title>Re: UndoManager change event listener</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/undomanager-change-event-listener/m-p/71256#M6329</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;John is correct UndoManager doesn't inherit from Evented. We will get this fixed for the next release of the ArcGIS API for JavaScript. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Aug 2014 18:09:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/undomanager-change-event-listener/m-p/71256#M6329</guid>
      <dc:creator>KellyHutchins</dc:creator>
      <dc:date>2014-08-15T18:09:03Z</dc:date>
    </item>
  </channel>
</rss>

