All Apps and Add-ons

Can the "allowAutoSubmit" parameter for Button module be a dynamic token?

cmak
Contributor

What I am looking for is to have a button allowAutoSubmit when a token is certain parameters, and not allow it for other parameters.

I have tried :

<module name="Button">
                    <param name="label">Search</param>
                    <param name="allowSoftSubmit">False</param>
                    <param name="allowAutoSubmit">$Test$</param>

where $Test$ is either True or False.

Is this possible?
If need be, I know the value of the button on page load, as it will be one of the parameters in the URL (UrlLoader)

sideview
SplunkTrust
SplunkTrust

Two different ways.

1) using customBehavior. As it happens this has been requested a few times via email from different people, so there is actually a customBehavior testcase hidden in Sideview Utils called "testcase_for_allowing_autosubmit_conditionally"

You'll see that the CustomBehavior definition in application.js is commented out, but if you uncomment it it will work, and if customBehavior feels like the right direction copy it over to your app. What it does is a little different - the customBehavior lets the autoSubmit through only if a particular dynamic Pulldown ends up with exactly one value. And if that Pulldown has more than one value, it denies the autoSubmit until the user makes an explicit selection.

2) Wait for the next release. I just made the allowAutoSubmit param on Button do $foo$ substitution such that you will be able to flip this switch via a simple upstream key, like <param name="allowAutoSubmit">$allowAutoSubmit$</param>.

To recap for those reading, how this comes up is as follows -

A) most of the time if you want to link to a Sideview view and prepopulate the form elements and load all the searches in that view, you just put autoRun="True" into the querystring and you're done.

B) However sometimes you want to kick off the searches for some Pulldowns you have up top, but you don't want to kick off the "main" search(es) lower down in the page, at least until the user picks some things in the form. This is easy and you set autoRun=True in the URL, but use a Sideview Button module lower down and set allowAutoSubmit to "False" on that. Aside from some usability problems where the elements below might look broken since they remain unloaded, it works (and I'm working on a nice simple sensible solution to that visibility problem)

C) Then restricting to yet a smaller subset of use cases, sometimes you want the autoSubmit to go through in some cases without user input, and to wait for user input in other cases.
Cue solutions #1 and #2 above.

0 Karma

sideview
SplunkTrust
SplunkTrust

Indeed this was implemented in 2.4.8, which released May 10 2013 http://sideviewapps.com/apps/sideview-utils/release-notes/

0 Karma

cmak
Contributor

Great, I think I will just wait for the next release of Sideview 🙂

0 Karma
Get Updates on the Splunk Community!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...