<?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: How to clear the previous value of the token in the form in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-clear-the-previous-value-of-the-token-in-the-form/m-p/186284#M11537</link>
    <description>&lt;P&gt;Dear dfoster_splunk,&lt;BR /&gt;
Thank you for your reply.&lt;BR /&gt;
I created the myscriot.js file, and modified the form.&lt;BR /&gt;
But it does not work well.&lt;BR /&gt;
so, I am investigating now.&lt;BR /&gt;
When I can set the default value to T_Host when T_Model changed, I will let you know.&lt;/P&gt;</description>
    <pubDate>Mon, 28 Sep 2020 17:22:13 GMT</pubDate>
    <dc:creator>ohuchi</dc:creator>
    <dc:date>2020-09-28T17:22:13Z</dc:date>
    <item>
      <title>How to clear the previous value of the token in the form</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-clear-the-previous-value-of-the-token-in-the-form/m-p/186282#M11535</link>
      <description>&lt;P&gt;Please let me know the way to clear the previous value of the token.&lt;/P&gt;

&lt;P&gt;I created the dashboard which has two input fields.&lt;BR /&gt;&lt;BR /&gt;
The first input field is for "Model".&lt;BR /&gt;&lt;BR /&gt;
The second input field is for "Host".&lt;BR /&gt;&lt;BR /&gt;
Each Host has only one Model.&lt;BR /&gt;&lt;BR /&gt;
One Model has some Host(s).&lt;BR /&gt;&lt;/P&gt;

&lt;P&gt;For example, at the begining, the value of the tokens are the default value.(T-Host = "*")&lt;BR /&gt;&lt;/P&gt;

&lt;OL&gt;
&lt;LI&gt;select M-1 for Model   (I can select H-1-1 or H-1-2 for Host)&lt;/LI&gt;
&lt;LI&gt;select H-1-2   (T-Model="M-1", T-Host = "H-1-2")&lt;/LI&gt;
&lt;LI&gt;select M-2 for Model   (I can select H-2-1 or H-2-2 for Host)&lt;/LI&gt;
&lt;/OL&gt;

&lt;P&gt;At this timing the second input field shows nothing.&lt;BR /&gt;&lt;BR /&gt;
But the value of T-Host is still "H-1-2".&lt;BR /&gt;&lt;BR /&gt;
I expect the value of T-Host is "*"(default).&lt;BR /&gt;&lt;BR /&gt;
I can not find the way to clear the value(set the default value) of token automatically when the relative field was changed.&lt;BR /&gt;&lt;/P&gt;

&lt;P&gt;The bottom part (panel chart) of the source code is for confirming the value of tokens.&lt;BR /&gt;&lt;BR /&gt;
regards,&lt;BR /&gt;&lt;/P&gt;

&lt;H3&gt;ABSTRACTION OF THE SOURCE CODE ###&lt;BR /&gt;&lt;/H3&gt;

&lt;P&gt;&amp;lt;form&amp;gt;&lt;BR /&gt;&lt;BR /&gt;
&amp;nbsp;&amp;nbsp;&amp;lt;fieldset autoRun="true" submitButton="false"&amp;gt;&lt;BR /&gt;&lt;BR /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;input type="dropdown" searchWhenChanged="true" token="T-Model"&amp;gt;&lt;BR /&gt;&lt;BR /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;populatingSearch fieldForValue="Nam-M"&amp;gt;SEARCH-STRING-1 | table Nam-H Nam-M]&amp;lt;/populatingSearch&amp;gt;&lt;BR /&gt;&lt;BR /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;label&amp;gt;Model&amp;lt;/label&amp;gt;&lt;BR /&gt;&lt;BR /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;/input&amp;gt;&lt;BR /&gt;&lt;BR /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;input type="dropdown" searchWhenChanged="true" token="T-Host"&amp;gt;&lt;BR /&gt;&lt;BR /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;populatingSearch fieldForValue="Nam-H"&amp;gt;SEARCH-STRING-2(Nam-M=$T-Model$) | table Nam-H Nam-M]&amp;lt;/populatingSearch&amp;gt;&lt;BR /&gt;&lt;BR /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;label&amp;gt;Host&amp;lt;/label&amp;gt;&lt;BR /&gt;&lt;BR /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;default&amp;gt;*&amp;lt;/default&amp;gt;&lt;BR /&gt;&lt;BR /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;/input&amp;gt;&lt;BR /&gt;&lt;BR /&gt;
&amp;nbsp;&amp;nbsp;&amp;lt;/fieldset&amp;gt;&lt;BR /&gt;&lt;BR /&gt;
&amp;nbsp;&amp;nbsp;&amp;lt;row&amp;gt;&amp;lt;panel&amp;gt;&amp;lt;chart&amp;gt;&lt;BR /&gt;&lt;BR /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;title&amp;gt;T-Model=[$T-Model$] T-Host=[$T-Host$]&amp;lt;/title&amp;gt;&lt;BR /&gt;&lt;BR /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;searchString&amp;gt;SEARCH-STRING-3&amp;lt;/searchString&amp;gt;&lt;BR /&gt;&lt;BR /&gt;
&amp;nbsp;&amp;nbsp;&amp;lt;/chart&amp;gt;&amp;lt;/panel&amp;gt;&amp;lt;/row&amp;gt;&lt;BR /&gt;&lt;BR /&gt;
&amp;lt;/form&amp;gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 19 Aug 2014 08:18:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-clear-the-previous-value-of-the-token-in-the-form/m-p/186282#M11535</guid>
      <dc:creator>ohuchi</dc:creator>
      <dc:date>2014-08-19T08:18:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to clear the previous value of the token in the form</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-clear-the-previous-value-of-the-token-in-the-form/m-p/186283#M11536</link>
      <description>&lt;P&gt;Sounds like you want the Host field to be set to "*" whenever the Model field changes.&lt;/P&gt;

&lt;P&gt;You could listen to changes in the Model field and force the Host field to "*" whenever that happens. However that would also make links/drilldowns to the dashboard be unable to set Host to anything other than asterisk, as all other values would get clobbered during page load.&lt;/P&gt;

&lt;P&gt;Should you want to take this approach anyway, you could create a JS file in appserver/static and include it with &amp;lt;form script="myscript.js"&amp;gt;:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;require(['splunkjs/ready!'], function(mvc) {
    var tokens = mvc.Components.get('default');
    tokens.on('change:T-Model', function() {
        tokens.set('T-Host', '*');
    });
});
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 19 Aug 2014 17:25:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-clear-the-previous-value-of-the-token-in-the-form/m-p/186283#M11536</guid>
      <dc:creator>dfoster_splunk</dc:creator>
      <dc:date>2014-08-19T17:25:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to clear the previous value of the token in the form</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-clear-the-previous-value-of-the-token-in-the-form/m-p/186284#M11537</link>
      <description>&lt;P&gt;Dear dfoster_splunk,&lt;BR /&gt;
Thank you for your reply.&lt;BR /&gt;
I created the myscriot.js file, and modified the form.&lt;BR /&gt;
But it does not work well.&lt;BR /&gt;
so, I am investigating now.&lt;BR /&gt;
When I can set the default value to T_Host when T_Model changed, I will let you know.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 17:22:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-clear-the-previous-value-of-the-token-in-the-form/m-p/186284#M11537</guid>
      <dc:creator>ohuchi</dc:creator>
      <dc:date>2020-09-28T17:22:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to clear the previous value of the token in the form</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-clear-the-previous-value-of-the-token-in-the-form/m-p/186285#M11538</link>
      <description>&lt;P&gt;Dear Ohuchi,&lt;/P&gt;

&lt;P&gt;Did you find the solution to this problem ? I am facing the same issue. If so, could you please share the solution ? &lt;/P&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Sun, 26 Apr 2015 02:35:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-clear-the-previous-value-of-the-token-in-the-form/m-p/186285#M11538</guid>
      <dc:creator>rupandit18</dc:creator>
      <dc:date>2015-04-26T02:35:40Z</dc:date>
    </item>
  </channel>
</rss>

