<?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: HTML SDK - How to set the NumericSpinner default value? in Dev Space</title>
    <link>https://community.alteryx.com/t5/Dev-Space/HTML-SDK-How-to-set-the-NumericSpinner-default-value/m-p/482402#M1069</link>
    <description>&lt;P&gt;&lt;a href="https://community.alteryx.com/t5/user/viewprofilepage/user-id/2387"&gt;@patrick_digan&lt;/a&gt;- Yes, yes it does! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; Thanks for the quick reply!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This was one of those issues that I should have just pressed on a little bit more ... because as soon as I posted my question, I switched over to the Console tab of the CEF I found the 'getDataItem()' of the manager and saw that I could invoke the setValue() method from there.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My final solution that work is below, where the 'LogicalRecordLength' string was the name of the new AlteryxDataItems.ConstrainedInt():&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;manager.getDataItem('LogicalRecordLength').setValue(47)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 29 Oct 2019 19:48:59 GMT</pubDate>
    <dc:creator>cam_w</dc:creator>
    <dc:date>2019-10-29T19:48:59Z</dc:date>
    <item>
      <title>HTML SDK - How to set the NumericSpinner default value?</title>
      <link>https://community.alteryx.com/t5/Dev-Space/HTML-SDK-How-to-set-the-NumericSpinner-default-value/m-p/482396#M1067</link>
      <description>&lt;P&gt;My custom tool requires a numeric input for which I'd like to use a NumericSpinner UI element. It worked just fine with the ConstrainedInt Data Item, and I'm using a min, max, and step values to control the user interaction nicely.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, I can't seem to see how to set the default value. The &lt;A href="https://help.alteryx.com/developer/APIReferenceDocumentation/class/gui/plugin-widgets/NumericSpinner/NumericSpinner.jsx~NumericSpinner.html" target="_self"&gt;NumericSpinner API documentation&lt;/A&gt; shows only the tabIndex is configurable. The &lt;A href="https://help.alteryx.com/developer/current/HTML/Use/DataItems.htm?tocpath=SDKs%7CBuild%20Custom%20Tools%7CHTML%20GUI%20SDK%7C_____2" target="_self"&gt;HTML GUI SDK Supported Data Items documentation&lt;/A&gt; says that ConstrainedInt has a default value of zero (depending on min and max values it appears), but that we can register a 'listener' for the 'value' property. However, the &lt;A href="https://help.alteryx.com/developer/APIReferenceDocumentation/class/gui/data-items/ConstrainedInt.jsx~ConstrainedInt.html" target="_self"&gt;ConstrainedInt API documentation&lt;/A&gt; does not show 'value' as part of the constructor or expose set/get for this property.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I can see the 'value' using the CEF debug tool, but this is 'too late' as the tool has already run to create the HTML interface. I need to set the default 'value' in the 'BeforeLoad' javascript function.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there a way to do this? Would I have to set the min to my default value, then run an AfterLoad function to set the min back to the true min?&lt;/P&gt;</description>
      <pubDate>Tue, 29 Oct 2019 19:32:46 GMT</pubDate>
      <guid>https://community.alteryx.com/t5/Dev-Space/HTML-SDK-How-to-set-the-NumericSpinner-default-value/m-p/482396#M1067</guid>
      <dc:creator>cam_w</dc:creator>
      <dc:date>2019-10-29T19:32:46Z</dc:date>
    </item>
    <item>
      <title>Re: HTML SDK - How to set the NumericSpinner default value?</title>
      <link>https://community.alteryx.com/t5/Dev-Space/HTML-SDK-How-to-set-the-NumericSpinner-default-value/m-p/482399#M1068</link>
      <description>&lt;P&gt;&lt;a href="https://community.alteryx.com/t5/user/viewprofilepage/user-id/33339"&gt;@cam_w&lt;/a&gt;&amp;nbsp; Does&amp;nbsp;&lt;a href="https://community.alteryx.com/t5/user/viewprofilepage/user-id/1443"&gt;@NeilR&lt;/a&gt;&amp;nbsp;'s post to &lt;A href="https://community.alteryx.com/t5/Weekly-Challenge/Challenge-143-Developer-Community-Anniversary-Edition/m-p/334718/highlight/true#M12174" target="_blank" rel="noopener"&gt;this challenge&lt;/A&gt; help? Here was his comment, note the script piece at the end.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;div class="widgetLabel"&amp;gt;Z&amp;lt;/div&amp;gt;
&amp;lt;ayx data-ui-props='{type:"NumericSpinner", widgetId:"z_spinner"}' data-item-props='{dataName:"z_spinner", dataType:"SimpleFloat", value:"1"}'&amp;gt;&amp;lt;/ayx&amp;gt;

&amp;lt;div class="widgetLabel"&amp;gt;Field to test&amp;lt;/div&amp;gt;
&amp;lt;ayx data-ui-props='{type:"DropDown", widgetId:"field_dropDown"}' data-item-props='{dataName:"field_dropDown", dataType:"FieldSelector"}'&amp;gt;&amp;lt;/ayx&amp;gt;

&amp;lt;script&amp;gt;
  Alteryx.Gui.BeforeLoad = function (manager, AlteryxDataItems, json) {
    manager.getDataItem('z_spinner').setValue(3)
  }
&amp;lt;/script&amp;gt; &lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Oct 2019 19:40:16 GMT</pubDate>
      <guid>https://community.alteryx.com/t5/Dev-Space/HTML-SDK-How-to-set-the-NumericSpinner-default-value/m-p/482399#M1068</guid>
      <dc:creator>patrick_digan</dc:creator>
      <dc:date>2019-10-29T19:40:16Z</dc:date>
    </item>
    <item>
      <title>Re: HTML SDK - How to set the NumericSpinner default value?</title>
      <link>https://community.alteryx.com/t5/Dev-Space/HTML-SDK-How-to-set-the-NumericSpinner-default-value/m-p/482402#M1069</link>
      <description>&lt;P&gt;&lt;a href="https://community.alteryx.com/t5/user/viewprofilepage/user-id/2387"&gt;@patrick_digan&lt;/a&gt;- Yes, yes it does! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; Thanks for the quick reply!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This was one of those issues that I should have just pressed on a little bit more ... because as soon as I posted my question, I switched over to the Console tab of the CEF I found the 'getDataItem()' of the manager and saw that I could invoke the setValue() method from there.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My final solution that work is below, where the 'LogicalRecordLength' string was the name of the new AlteryxDataItems.ConstrainedInt():&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;manager.getDataItem('LogicalRecordLength').setValue(47)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Oct 2019 19:48:59 GMT</pubDate>
      <guid>https://community.alteryx.com/t5/Dev-Space/HTML-SDK-How-to-set-the-NumericSpinner-default-value/m-p/482402#M1069</guid>
      <dc:creator>cam_w</dc:creator>
      <dc:date>2019-10-29T19:48:59Z</dc:date>
    </item>
    <item>
      <title>Re: HTML SDK - How to set the NumericSpinner default value?</title>
      <link>https://community.alteryx.com/t5/Dev-Space/HTML-SDK-How-to-set-the-NumericSpinner-default-value/m-p/675433#M1379</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.alteryx.com/t5/user/viewprofilepage/user-id/2387"&gt;@patrick_digan&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Do you know how to set it's value in afterLoad function? Because I am using a drop down and based on a specific value selected in drop-down it unhides 2 numberspinners. But it is throwing error saying dataitemcontainers are not allowed in macro mode. As Engine of this tool is macro only.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please let me know if you have any suggestion here. Thanks in advance!&lt;/P&gt;</description>
      <pubDate>Thu, 03 Dec 2020 18:18:00 GMT</pubDate>
      <guid>https://community.alteryx.com/t5/Dev-Space/HTML-SDK-How-to-set-the-NumericSpinner-default-value/m-p/675433#M1379</guid>
      <dc:creator>RuchikaMangla</dc:creator>
      <dc:date>2020-12-03T18:18:00Z</dc:date>
    </item>
  </channel>
</rss>

