<?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 to event based on met criteria in Web AppBuilder Custom Widgets Questions</title>
    <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/listen-to-event-based-on-met-criteria/m-p/773853#M1881</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Lefteris,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;I have my checkboxes in my Widget.html file with data-dojo-attach-point property and use:&lt;/P&gt;&lt;P&gt;this.shareCbx.setValue(true);&lt;/P&gt;&lt;P&gt;if I want to check the checkbox&lt;/P&gt;&lt;P&gt;I tend to use the lightweight&amp;nbsp;jimu/dijit/CheckBox though.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 07 Mar 2017 00:08:42 GMT</pubDate>
    <dc:creator>RobertScheitlin__GISP</dc:creator>
    <dc:date>2017-03-07T00:08:42Z</dc:date>
    <item>
      <title>listen to event based on met criteria</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/listen-to-event-based-on-met-criteria/m-p/773848#M1876</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a number of check boxes that users can click on to activate a layer on each checkbox. After a number of check boxes &amp;nbsp;clicked, I would like to capture the click event but not check the checkbox (stop any further actions), and inform the user that the max number of boxes is reached. If the user deselect a checkbox, then the functionality is restored again.&lt;/P&gt;&lt;P&gt;Suggestions? Thanks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;this.own(on(layerCheckbox.domNode, 'click', lang.hitch(this,&amp;nbsp;function(){&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;if (numberofcheckboxes &amp;gt;5) //criteria met&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; --------------&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;} else {&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;})&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Mar 2017 21:00:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/listen-to-event-based-on-met-criteria/m-p/773848#M1876</guid>
      <dc:creator>LefterisKoumis</dc:creator>
      <dc:date>2017-03-06T21:00:46Z</dc:date>
    </item>
    <item>
      <title>Re: listen to event based on met criteria</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/listen-to-event-based-on-met-criteria/m-p/773849#M1877</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Lefteris,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;That is normally what you would use dojo on.pausable for:&lt;/P&gt;&lt;P&gt;&lt;A class="link-bare" href="https://dojotoolkit.org/reference-guide/1.10/dojo/on.html#pausable" title="https://dojotoolkit.org/reference-guide/1.10/dojo/on.html#pausable"&gt;https://dojotoolkit.org/reference-guide/1.10/dojo/on.html#pausable&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Mar 2017 21:04:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/listen-to-event-based-on-met-criteria/m-p/773849#M1877</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2017-03-06T21:04:38Z</dc:date>
    </item>
    <item>
      <title>Re: listen to event based on met criteria</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/listen-to-event-based-on-met-criteria/m-p/773850#M1878</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you Robert. However it is not to going to work for me. I modified my question because I realized that is not clear enough.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Mar 2017 22:41:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/listen-to-event-based-on-met-criteria/m-p/773850#M1878</guid>
      <dc:creator>LefterisKoumis</dc:creator>
      <dc:date>2017-03-06T22:41:43Z</dc:date>
    </item>
    <item>
      <title>Re: listen to event based on met criteria</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/listen-to-event-based-on-met-criteria/m-p/773851#M1879</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Lefteris,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;I would suggest you not spend time on trying to prevent the check. I would handle this by just un-checking the checkbox if the max checkbox count has been meet.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Mar 2017 23:02:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/listen-to-event-based-on-met-criteria/m-p/773851#M1879</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2017-03-06T23:02:23Z</dc:date>
    </item>
    <item>
      <title>Re: listen to event based on met criteria</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/listen-to-event-based-on-met-criteria/m-p/773852#M1880</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, you are correct. It seems to be too complex to prevent the check. However, I tried this below and it has no effect on the checkbox. The checkbox remains checked after the user clicked on it. The script below is from the function called when the user clicked on the checkbox, however it does not deselect the checkbox. The checkbox id has been assigned the layer name. Console shows false and the layer name meaning that the checkbox is correctly identified. Any obvious errors? Thank you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if (numberoflayers &amp;gt; 4){ &lt;BR /&gt; alert("Sorry, no more layers than 5 layer can be selected. Please remove a layer before you can add another one.")&lt;BR /&gt; var thestatus = registry.byId(layer.name);&lt;BR /&gt;thestatus.set("checked", false);&lt;/P&gt;&lt;P&gt;console.log(thestatus.checked + " " + layer.name);&lt;BR /&gt; return;&lt;BR /&gt; } else {&lt;BR /&gt; this.addLayerToMap(layer);&lt;BR /&gt; }&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Mar 2017 23:48:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/listen-to-event-based-on-met-criteria/m-p/773852#M1880</guid>
      <dc:creator>LefterisKoumis</dc:creator>
      <dc:date>2017-03-06T23:48:06Z</dc:date>
    </item>
    <item>
      <title>Re: listen to event based on met criteria</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/listen-to-event-based-on-met-criteria/m-p/773853#M1881</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Lefteris,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;I have my checkboxes in my Widget.html file with data-dojo-attach-point property and use:&lt;/P&gt;&lt;P&gt;this.shareCbx.setValue(true);&lt;/P&gt;&lt;P&gt;if I want to check the checkbox&lt;/P&gt;&lt;P&gt;I tend to use the lightweight&amp;nbsp;jimu/dijit/CheckBox though.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Mar 2017 00:08:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/listen-to-event-based-on-met-criteria/m-p/773853#M1881</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2017-03-07T00:08:42Z</dc:date>
    </item>
    <item>
      <title>Re: listen to event based on met criteria</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/listen-to-event-based-on-met-criteria/m-p/773854#M1882</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks. My checkboxes are constructed &amp;nbsp;during design time and it seems to be a bit more complex to programmatically check or uncheck the boxes.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Mar 2017 16:24:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/listen-to-event-based-on-met-criteria/m-p/773854#M1882</guid>
      <dc:creator>LefterisKoumis</dc:creator>
      <dc:date>2017-03-07T16:24:21Z</dc:date>
    </item>
    <item>
      <title>Re: listen to event based on met criteria</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/listen-to-event-based-on-met-criteria/m-p/773855#M1883</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Lefteris,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; If they are created at design time then that would make it pretty simple.&lt;/P&gt;&lt;P&gt;Widget.html&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="operator token"&gt;&amp;lt;&lt;/SPAN&gt;div data&lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;dojo&lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;type&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"jimu/dijit/CheckBox"&lt;/SPAN&gt; data&lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;dojo&lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;attach&lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;point&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"allowCSVExport"&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; data&lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;dojo&lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;props&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"label:'${nls.allowcsvexport}'"&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;/&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Widget.js&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;this&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;allowCSVExport&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;setValue&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="keyword token"&gt;false&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 08:40:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/listen-to-event-based-on-met-criteria/m-p/773855#M1883</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2021-12-12T08:40:08Z</dc:date>
    </item>
    <item>
      <title>Re: listen to event based on met criteria</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/listen-to-event-based-on-met-criteria/m-p/773856#M1884</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry,&amp;nbsp;I mispoke.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The html file is in the form shown below, &amp;nbsp;and in the js file I declare and create the checkboxes in each layerlist. I place each check box on a row in a table, &amp;nbsp;similar to the AddLayer widget. By the way, how can I post code on the forum with the numbering?&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;&amp;lt;div data-dojo-type="dijit/layout/TabContainer" style=" height: 700px; " &amp;gt;&lt;BR /&gt; &amp;lt;div data-dojo-type="dijit/layout/ContentPane" title="General Environmental" &amp;gt;&lt;BR /&gt; &amp;lt;div data-dojo-attach-point="layerListGenEnv"&amp;gt; &amp;lt;/div&amp;gt;&lt;BR /&gt; &amp;lt;/div&amp;gt; &lt;BR /&gt; &amp;lt;div data-dojo-type="dijit/layout/TabContainer" title="Biology" nested="true"&amp;gt;&lt;BR /&gt; &amp;lt;div data-dojo-type="dijit/layout/ContentPane" title="Fish" data-dojo-props="selected:true" style=""&amp;gt;&lt;BR /&gt; &amp;lt;div data-dojo-attach-point="layerListFish"&amp;gt; &amp;lt;/div&amp;gt;&lt;BR /&gt; &amp;lt;/div&amp;gt;&lt;BR /&gt; &amp;lt;div data-dojo-type="dijit/layout/ContentPane" title="Wildlife"&amp;gt;&lt;BR /&gt; &amp;lt;div data-dojo-attach-point="layerListWildlife"&amp;gt; &amp;lt;/div&amp;gt;&lt;BR /&gt; &amp;lt;/div&amp;gt;&lt;BR /&gt; &amp;lt;div data-dojo-type="dijit/layout/ContentPane" title="Vegetation"&amp;gt;&lt;BR /&gt; &amp;lt;div data-dojo-attach-point="layerListVegetation"&amp;gt; &amp;lt;/div&amp;gt;&lt;BR /&gt; &amp;lt;/div&amp;gt;&lt;BR /&gt; &amp;lt;/div&amp;gt;&lt;/P&gt;&lt;P&gt;---------&lt;/P&gt;&lt;P&gt;--------&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Mar 2017 16:39:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/listen-to-event-based-on-met-criteria/m-p/773856#M1884</guid>
      <dc:creator>LefterisKoumis</dc:creator>
      <dc:date>2017-03-07T16:39:54Z</dc:date>
    </item>
    <item>
      <title>Re: listen to event based on met criteria</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/listen-to-event-based-on-met-criteria/m-p/773857#M1885</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Lefteris,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; So what does your Widget.js code look like for adding the checkboxes?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/people/curtvprice/blog/2014/09/25/posting-code-blocks-in-the-new-geonet"&gt;https://community.esri.com/people/curtvprice/blog/2014/09/25/posting-code-blocks-in-the-new-geonet&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Mar 2017 17:15:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/listen-to-event-based-on-met-criteria/m-p/773857#M1885</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2017-03-07T17:15:54Z</dc:date>
    </item>
    <item>
      <title>Re: listen to event based on met criteria</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/listen-to-event-based-on-met-criteria/m-p/773858#M1886</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I &amp;nbsp;resolved the situation by using:&lt;/P&gt;&lt;P&gt;&amp;nbsp;registry.byId(mycheckbox).setValue(false);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I don't know why the&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;registry.byId(mycheckbox).set("checked", false)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;does not work.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Mar 2017 22:53:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/listen-to-event-based-on-met-criteria/m-p/773858#M1886</guid>
      <dc:creator>LefterisKoumis</dc:creator>
      <dc:date>2017-03-10T22:53:34Z</dc:date>
    </item>
  </channel>
</rss>

