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...
The only other thing is to make sure your default/my_app.conf file has the list values for your placeholder. Hope this helps.
$(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 < 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
});
<setup>
<block title="my_app Credentials" endpoint="my_app_setup/my_app_1" entity="my_app_1">
<input field="username">
<label>Username*</label>
<type>text</type>
</input>
<input field="password">
<label>Password*</label>
<type>password</type>
</input>
<input field="authentication_type_placeholder">
<label>hidden field to get auth values,native,basic,form</label>
<type>text</type>
</input>
<input field="authentication_type">
<label>my_app Authentication</label>
<type>text</type>
</input>
</block>
</setup>
... View more