All Apps and Add-ons

Sideview Utils: How to find hidden default value of a pull-down?

vspreethi17
Explorer

Scenario : I have 4 pull downs , where 2 pull downs are primary and other 2 pull downs(usually hidden) opens up on choosing primary pull downs.
so, when I write a query from the options chosen, default values are not replaced in the query , Let me know how to set the default value when not chosen.
In short: I want to have a hidden default value of a pull down.
Thanks.

sideview
SplunkTrust
SplunkTrust

Figured a late answer is better than no answer. Sorry I didn't come back and write more of a proper answer when my followup questions went unanswered.

I still think the right answer for your case is to take a look at how you're doing the show/hide, because perhaps we can integrate it with that existing stuff.

However, technically there's an easy answer, in that you can use the Sideview ValueSetter module to supply a general purpose default value for any and all cases where the real token might be blank.

If you're doing anything as advanced as using a CustomBehavior to show/hide modules on the page, you should absolutely read up on ValueSetter. Within the app use the Navigation bar to go to "Module Documentation > The ValueSetter Modules > The ValueSetter Module".

The reason I advise this, is that for a huge range of cases where you might think you need a CustomBehavior, you can actually use ValueSetter or it's cousins ResultsValueSetter and ArrayValueSetter instead and thus avoid writing the custom JS .

0 Karma

sideview
SplunkTrust
SplunkTrust

Well the most straightforward way to have a default value in a Pulldown is of course to have it in the "staticOptions" param as the first statically configured option. There are other more complex ways of doing similar things, involving using a ValueSetter module either upstream or downstream from the Pulldown.

However the heart of the matter seems to be -- how are you currently making the secondary Pulldowns show and hide? Have you written a Sideview customBehavior? Is this a desired interaction design that you haven't implemented yet?

Because in Sideview XML, I would probably do both the show/hide behavior, and also the default value, all from a JS custombehavior attached to the secondary pulldowns. If you provide whatever XML (and JS) you have, I can advise and put together a working example.

0 Karma

immortalraghava
Path Finder

Is it possible to stop giving implicit values to the pulldown ? I have not specified the staticOptions tag itself, even then the value All shows up in the results. That is wrong. I don't want All option.

0 Karma

sideview
SplunkTrust
SplunkTrust

There is a page of docs and examples in the Sideview Utils docs about the staticOptions param, whose main topic is how to remove the "all" or customize it's behavior. Within the app, use the Navigation bar to go to "Module Documentation > Form search modules > The Pulldown module > Pulldown - configuring the 'all' options".

On that page you'll see some simple docs about this and a number of working examples showing the relevant config in action. Go to that page to learn more. You can click "View the XML source for this" as well to see the raw xml in a new window.

tl;dr - what you want is to specify a staticOptions param explicitly, with an empty value - <param name="staticOptions"></param>.

0 Karma
Register for .conf21 Now! Go Vegas or Go Virtual!

How will you .conf21? You decide! Go in-person in Las Vegas, 10/18-10/21, or go online with .conf21 Virtual, 10/19-10/20.