All Apps and Add-ons

setup.xml bool field "checked/unchecked"

nickhills
Ultra Champion

I have a setup screen for my application which allows the users to choose to enable/disable the index my application uses.

<input field="disabled">
  <label>Disable My Index</label>
  <type>bool</type>
</input>

Since my default/index.conf contains disabled=true when the setup page is rendered the tickbox is checked by default.
Is there a way to override the setup UI to disregard the effective result of the conf files such that it displays "unchecked"?

In an ideal world I would like to keep disabled=true in the default/index.conf (as required for app Certification) but the default option during setup to effectively enable the index?

This question also extends to inputs:
I would like my default/inputs.conf to have disabled=true, but the setup UI to have disabled=false as the default action.
Am I overlooking something obvious?

If my comment helps, please give it a thumbs up!
0 Karma
1 Solution

jkat54
SplunkTrust
SplunkTrust

The general rule of thumb is to allow the user to specifically enable what they want and leave whatever they like disabled.

I wouldnt override this behavior because it should always be the users choice even if that involves possibly mis-configuring the app.

Instead I would put notes explaining why they SHOULD enable it regardless of their preconceived notions.

View solution in original post

0 Karma

jkat54
SplunkTrust
SplunkTrust

The general rule of thumb is to allow the user to specifically enable what they want and leave whatever they like disabled.

I wouldnt override this behavior because it should always be the users choice even if that involves possibly mis-configuring the app.

Instead I would put notes explaining why they SHOULD enable it regardless of their preconceived notions.

0 Karma

nickhills
Ultra Champion

To a degree I guess it comes down to semantics - when the app is installed the various options are disabled. The setup screen is the users chance to easily enable the features necessary for the app to work.

I appricate that good Ux and security do not always go hand in hand, thus:
"Technical control" beats "flowers and butterflys!"

Thanks for your comment - I had already made the descriptions more "persuasive" but I think I am in agreement.

If my comment helps, please give it a thumbs up!
0 Karma

jkat54
SplunkTrust
SplunkTrust

Another option may be to leave it blank in your default conf file... and use javascript to check it in setup.xml

0 Karma

jkat54
SplunkTrust
SplunkTrust

Something like this should work if you put it in the <text> field

          <![CDATA[
          <script language="javascript">
              $(document).ready(function() {
                 $("#yourCheckboxFieldName").val( current_value ).attr('selected',true);
              });
          </script>
          ]]>

jkat54
SplunkTrust
SplunkTrust

@nickhillscpl wanted to be sure you see the js i left ...

0 Karma

nickhills
Ultra Champion

ji @jkat54 - yes thanks. I might give it a spin

If my comment helps, please give it a thumbs up!
0 Karma
Get Updates on the Splunk Community!

Webinar Recap | Revolutionizing IT Operations: The Transformative Power of AI and ML ...

The Transformative Power of AI and ML in Enhancing Observability   In the realm of IT operations, the ...

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...