Refine your search:

I have several dashboards that I use the Sideview Utils Pulldown module on. The pulldowns grab a list of industries and customers out of our customer data, and then pass these values on to downstream searches. This works all without a problem, however when the Pulldowns are populated, they kick off the downstream searches automatically, causing all downstream searches to display data for All customers on page load.

What I want them to do is load the pulldown values on page load, but not autoRun the searches downstream -- I want a submit button or similar so I can first select my desired pulldown combination before kicking off the downstream searches. I have tried SubmitButton and different autoRun=true/false combinations to no avail.

Dashboard code:

<view autoCancelInterval="90" isVisible="true" onunloadCancelJobs="true" template="dashboard.html" isSticky="False">
    <label>My label</label>
    <module name="AccountBar" layoutPanel="appHeader" />
    <module name="AppBar" layoutPanel="appHeader" />
    <module name="SideviewUtils" layoutPanel="appHeader" />

    <module name="Message" layoutPanel="messaging">
    <param name="filter">splunk.search.error</param>
    <param name="maxSize">1</param>
    <param name="clearOnJobDispatch">False</param>
    </module>

    <module name="TitleBar" layoutPanel="viewHeader">
        <param name="actionsMenuFilter">dashboard</param>
    </module>

    <module name="Search" layoutPanel="panel_row1_col1" group="" autoRun="true">
        <param name="search">| inputlookup host_customer_lookup | where host!="" | dedup industry | fields industry</param>
        <param name="earliest">-60d@d</param>
        <param name="latest">now</param>

        <module name="Pulldown">
            <param name="searchFieldsToDisplay">
                <list>
                  <param name="value">industry</param>
                  <param name="label">Industry</param>
                </list>
            </param>
            <param name="name">selectedIndustry</param>
            <param name="label">Industry</param>

            <module name="Search" layoutPanel="panel_row1_col1" group="" autoRun="true">
                <param name="search">| inputlookup host_customer_lookup | where host!="" | search industry="$selectedIndustry$" | dedup customer | fields customer</param>
                <param name="earliest">-60d@d</param>
                <param name="latest">now</param>
                <module name="Pulldown">
                    <param name="searchFieldsToDisplay">
                        <list>
                          <param name="value">customer</param>
                          <param name="label">Customer</param>
                        </list>
                    </param>
                    <param name="name">selectedCustomer</param>
                    <param name="label">Customer</param>

                    <module name="TimeRangePicker">
                        <param name="default">-60d@d</param>

                        <module name="Search" layoutPanel="panel_row2_col1" group="" autoRun="false">
                            <param name="search">some search industry="$selectedIndustry$" customer="$selectedCustomer$" | timechart avg(somevalue) by customer</param>
                            <module name="HiddenChartFormatter">
                                <param name="chart">line</param>
                                <param name="legend.placement">right</param>
                                <param name="chart.nullValueMode">zero</param>
                                <param name="primaryAxisTitle.text">Time</param>
                                <param name="secondaryAxisTitle.text">Hours Mined</param>
                                <module name="JSChart">
                                    <param name="width">100%</param>
                                </module>
                            </module>
                        </module>
                    </module>
                    <!-- end timepicker-->
                    <module name="Search" layoutPanel="panel_row3_col1" group="" autoRun="false">
                        <param name="search">some otgher search  industry="$selectedIndustry$" customer="$selectedCustomer$" </param>
                            <module name="SimpleResultsTable">
                                <param name="count">30</param>
                                <param name="displayRowNumbers">False</param>
                                <param name="drilldown">none</param>
                            </module>
                    </module>

                </module>
            </module>
        </module>
    </module>

</view>

asked 13 Feb, 08:26

ftk's gravatar image

ftk ♦
6.2k419
accept rate: 37%

edited 13 Feb, 08:36


One Answer:

You may get some mileage out of the Button module. Button is much like Splunk's SubmitButton module, except that a) it has an "allowAutoSubmit" param that does something pretty close to what you're looking for here, b) it allows a "customBehavior" to be attached to it, like any other Sideview module. c) The code was written from scratch so it's cleaner and simpler than SubmitButton and has less going on.

So.

1) Add a Button module after your controls, 2) give it allowAutoSubmit False

That will get you most of the way there. (I still recommend setting allowSoftSubmit to "True", despite the allowAutoSubmit "False".)

However at a practical level there's always some confusion that you have to clean up. This is because when the page loads, the interface elements below the button "sort of" load when the page loads. Some things will be visible, some wont. Often the page looks broken overall and nothing "inhibits user interaction" quite like borkedness.

What I have done in these situations is use the app's CSS to make certain div containers invisible in that view on page load, and then put a CustomBehavior module downstream from the SubmitButton, and onContextChange within that customBehavior, make those div containers visible using jquery.

PS. Actually I lied, what I do is put a customBehavior param on the Button itself, but this is more advanced -- definitely if you're not really used to customBehaviors and not really familiar with the module framework methods, use the flavorless CustomBehavior module and stay away from trying to tinker with an existing module's methods in vivo.

link

answered 13 Feb, 11:54

nick's gravatar image

nick ♦
14.2k1318
accept rate: 46%

Hey Nick, thanks for the pointers. Button did indeed work, however I had to put both allowAutoSubmit and allowSoftSubmit to false. Setting allowSoftSubmit to false didn't garble the dashboard up in my case, all charts are invisible, works for me. Thanks!

(13 Feb, 12:49) ftk ♦

Sorry I should have been clear -- I didn't recommend allowSoftSubmit True because there was any weird interaction with allowAutoSubmit. I just recommend allowSoftSubmit True because it's more of a standard across Splunk apps, and if you hit a user who's only used apps where it's set to True, they sometimes think that the UI is broken when the results never appear, and they never think to click the green button. Feel free to set allowSoftSubmit to whatever you like -- it will have no effect on allowAutoSubmit and the two params do separate things and function independently.

(13 Feb, 14:13) nick ♦
Post your answer
toggle preview

Follow this question

Log In to enable email subscriptions

RSS:

Answers

Answers + Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "Title")
  • image?![alt text](/path/img.jpg "Title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×161
×3

Asked: 13 Feb, 08:26

Seen: 166 times

Last updated: 13 Feb, 14:13

Copyright © 2005-2012 Splunk, Inc. All rights reserved.