<?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: Setup.xml dropdown list in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/Setup-xml-dropdown-list/m-p/157845#M9739</link>
    <description>&lt;P&gt;@sarumjanuch , Any updates? Did you find any answer?&lt;/P&gt;</description>
    <pubDate>Thu, 13 Jun 2019 12:37:10 GMT</pubDate>
    <dc:creator>harshpatel</dc:creator>
    <dc:date>2019-06-13T12:37:10Z</dc:date>
    <item>
      <title>Setup.xml dropdown list</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Setup-xml-dropdown-list/m-p/157841#M9735</link>
      <description>&lt;P&gt;Who knows, how to implment dropdow for setup.xml, i can se in documentation that there is type "list", but here shoud i pupulate values for it?&lt;/P&gt;</description>
      <pubDate>Wed, 27 Nov 2013 11:58:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Setup-xml-dropdown-list/m-p/157841#M9735</guid>
      <dc:creator>sarumjanuch</dc:creator>
      <dc:date>2013-11-27T11:58:40Z</dc:date>
    </item>
    <item>
      <title>Re: Setup.xml dropdown list</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Setup-xml-dropdown-list/m-p/157842#M9736</link>
      <description>&lt;P&gt;I don't believe that lists were ever fully implemented in setup.xml. You could fake it by including your own JavaScript though.&lt;/P&gt;</description>
      <pubDate>Sun, 08 Dec 2013 02:18:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Setup-xml-dropdown-list/m-p/157842#M9736</guid>
      <dc:creator>LukeMurphey</dc:creator>
      <dc:date>2013-12-08T02:18:10Z</dc:date>
    </item>
    <item>
      <title>Re: Setup.xml dropdown list</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Setup-xml-dropdown-list/m-p/157843#M9737</link>
      <description>&lt;P&gt;That is actualy waht i did. If someone need, i cant post it here.&lt;/P&gt;</description>
      <pubDate>Sun, 08 Dec 2013 12:02:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Setup-xml-dropdown-list/m-p/157843#M9737</guid>
      <dc:creator>sarumjanuch</dc:creator>
      <dc:date>2013-12-08T12:02:06Z</dc:date>
    </item>
    <item>
      <title>Re: Setup.xml dropdown list</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Setup-xml-dropdown-list/m-p/157844#M9738</link>
      <description>&lt;P&gt;Hi Sarumjanuch,&lt;/P&gt;

&lt;P&gt;can you please post your solution?&lt;/P&gt;</description>
      <pubDate>Sat, 16 Dec 2017 10:29:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Setup-xml-dropdown-list/m-p/157844#M9738</guid>
      <dc:creator>gaurav_maniar</dc:creator>
      <dc:date>2017-12-16T10:29:55Z</dc:date>
    </item>
    <item>
      <title>Re: Setup.xml dropdown list</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Setup-xml-dropdown-list/m-p/157845#M9739</link>
      <description>&lt;P&gt;@sarumjanuch , Any updates? Did you find any answer?&lt;/P&gt;</description>
      <pubDate>Thu, 13 Jun 2019 12:37:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Setup-xml-dropdown-list/m-p/157845#M9739</guid>
      <dc:creator>harshpatel</dc:creator>
      <dc:date>2019-06-13T12:37:10Z</dc:date>
    </item>
    <item>
      <title>Re: Setup.xml dropdown list</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Setup-xml-dropdown-list/m-p/157846#M9740</link>
      <description>&lt;P&gt;Hello @sarumjanuch and @harshpatel,&lt;/P&gt;

&lt;P&gt;Right now I don't have full solution implemented but what you can do is:&lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;From your python handler convert your list to string and provide in normal text field on setup page (textField-1)&lt;/LI&gt;
&lt;LI&gt;Create another text field with default value of dropdown (textField-2)&lt;/LI&gt;
&lt;LI&gt;Write application.js file and put under appserver/static&lt;/LI&gt;
&lt;LI&gt;Write method  &lt;CODE&gt;$(document).ready(function() {&lt;/CODE&gt;&lt;/LI&gt;
&lt;LI&gt;Inside that write code to follow below steps&lt;/LI&gt;
&lt;LI&gt;Hide above textField-1 and textField-2&lt;/LI&gt;
&lt;LI&gt;Get value from that textField1, convert it to Js list&lt;/LI&gt;
&lt;LI&gt;Use above Js list and create select (dropdown)&lt;/LI&gt;
&lt;LI&gt;Use value from textField-2 to select default value in dropdown&lt;/LI&gt;
&lt;LI&gt;Write function  &lt;CODE&gt;$(".splButton-primary").on("click", function(e){&lt;/CODE&gt; and add code to read the selected value from the dropdown and put that value in textField-2&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;Hope this helps to understand the flow how you can implement it.&lt;/P&gt;</description>
      <pubDate>Thu, 13 Jun 2019 14:59:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Setup-xml-dropdown-list/m-p/157846#M9740</guid>
      <dc:creator>VatsalJagani</dc:creator>
      <dc:date>2019-06-13T14:59:58Z</dc:date>
    </item>
    <item>
      <title>Re: Setup.xml dropdown list</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Setup-xml-dropdown-list/m-p/157847#M9741</link>
      <description>&lt;P&gt;This works. Here is my application.js  and setup.xml file for anyone else fighting with this. Splunk please add support... it's a lot of work for a list...&lt;/P&gt;

&lt;P&gt;The only other thing is to make sure your default/my_app.conf file has the list values for your placeholder. Hope this helps.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;$(document).ready(function() {
    auth_type_placeholder_div_id = "item-/my_app_setup/my_app_1/my_app_1/authentication_type_placeholder"
    auth_type_input_id = "/my_app_setup/my_app_1/my_app_1/authentication_type_id"
    auth_type_id = "/my_app_setup/my_app_1/my_app_1/authentication_type_id"
    auth_type_placeholder_id = "/my_app_setup/my_app_1/my_app_1/authentication_type_placeholder_id"

    // hide the auth inputs auth inputs
    document.getElementById(auth_type_placeholder_div_id).style.display='none'
    document.getElementById(auth_type_input_id).style.display='none'

    // convert the values in placeholder (comes from default/my_app.conf) to an array for the select
    list_of_values = document.getElementById(auth_type_placeholder_id).value.split(',')

    // create a select with the auth input is
    auth_div = document.getElementById(auth_type_input_id)
    frag = document.createDocumentFragment()
    select = document.createElement("select")
    select.id = "auth_type_select"
    select.style.visibility='visible'
    for (index = 0; index &amp;lt; list_of_values.length; index++) { 
        select.options.add(new Option(list_of_values[index]))
    } 
    frag.appendChild(select)
    auth_div.parentNode.insertBefore(frag, auth_div.nextSibling);

    // select the current value
    select.value = document.getElementById(auth_type_id).value
});

$(".splButton-primary").on("click", function(e){
    // get the value of the selection
    document.getElementById(auth_type_id).value = document.getElementById('auth_type_select').value
});

&amp;lt;setup&amp;gt;
    &amp;lt;block title="my_app Credentials" endpoint="my_app_setup/my_app_1" entity="my_app_1"&amp;gt;
        &amp;lt;input field="username"&amp;gt;
            &amp;lt;label&amp;gt;Username*&amp;lt;/label&amp;gt;
            &amp;lt;type&amp;gt;text&amp;lt;/type&amp;gt;
        &amp;lt;/input&amp;gt;
        &amp;lt;input field="password"&amp;gt;
            &amp;lt;label&amp;gt;Password*&amp;lt;/label&amp;gt;
            &amp;lt;type&amp;gt;password&amp;lt;/type&amp;gt;
        &amp;lt;/input&amp;gt;
        &amp;lt;input field="authentication_type_placeholder"&amp;gt;
            &amp;lt;label&amp;gt;hidden field to get auth values,native,basic,form&amp;lt;/label&amp;gt;
            &amp;lt;type&amp;gt;text&amp;lt;/type&amp;gt;
        &amp;lt;/input&amp;gt;
        &amp;lt;input field="authentication_type"&amp;gt;
            &amp;lt;label&amp;gt;my_app Authentication&amp;lt;/label&amp;gt;
            &amp;lt;type&amp;gt;text&amp;lt;/type&amp;gt;
        &amp;lt;/input&amp;gt;
    &amp;lt;/block&amp;gt;
&amp;lt;/setup&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 04 Mar 2020 16:19:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Setup-xml-dropdown-list/m-p/157847#M9741</guid>
      <dc:creator>aronsemle</dc:creator>
      <dc:date>2020-03-04T16:19:57Z</dc:date>
    </item>
  </channel>
</rss>

