All Apps and Add-ons

Issue in Sideview Utils: pulldown causes dashboard refresh before submit button

keerthana_k
Communicator

Hi,

We have an existing dashboard that makes use of sideview utils Pulldown and TextField modules. The layout is as following:

Pulldown1    TextField    Pulldown2      SubmitButton

Our requirement was that any changes in the Pulldown and Textfield modules should not take effect until Submit button is clicked. This was working fine. Now, we have added a Pulldown3 before the Submit button. This pulldown depends on the previous pulldown value ie when any value in Pulldown 2 is changed, Pulldown3 should be refreshed. Once we added this pulldown, the dashboard has started getting refreshed when any of the pull down value gets changed.

Please point us to where we are getting it wrong. Pasted below is the xml for the pulldowns.

<module name="Search" layoutPanel="viewHeader" autoRun="True">

<param name="search">Search Macro(-7d@d)</param>

<module name="Pulldown">

<param name="name">arg1</param>

<param name="label">In :</param>

<param name="staticOptions"> </param>

<param name="valueField">Value</param>

<param name="labelField">Label</param>

<param name="clear">true</param>

<module name="TextField">

<param name="name">arg2</param>

<param name="label"> search :</param>

<param name="default">Enter Search String</param>

<param name="float">inherit</param>

<param name="width">250px</param>

<module name="Pulldown">

<param name="name">timeFilter</param>

<param name="label">over Time Range:</param>

<param name="staticOptions">

<list>

<param name="label">Previous Day</param>

<param name="value">pd</param>

</list>

<list>

<param name="label">Last 7 Days</param>

<param name="value">1d</param>

</list>

<list>

<param name="label">Last 30 Days</param>

<param name="value">1w</param>

</list>

<list>

<param name="label">Last 365 Days</param>

<param name="value">1mon</param>

</list>

<module name="Search" layoutPanel="viewHeader" autoRun="True">

<param name="search">|Time_Span_Selection($timeFilter.label$)</param>

<module name="Pulldown">

<param name="name">span</param>

<param name="label">in Intervals of:</param>

<param name="staticOptions"> </param>

<param name="valueField">Value</param>

<param name="labelField">Label</param>

<param name="clear">true</param>

<module name="SubmitButton">

<param name="allowSoftSubmit">False</param>

<param name="label">Search</param>

</param>

Tags (1)
1 Solution

sideview
SplunkTrust
SplunkTrust

This falls under "the perils of editing XML by hand".

When you added the last Pulldown, you have a wayward </param> tag in there, such that the |Time_Span_Selection($timeFilter.label$) Search module, the span Pulldown, and the SubmitButton are all trapped inside the timeFilter Pulldown's staticOptions param.

Look closely and you'll see that after the last staticOption in the timeFilter Pulldown, there is no </param> there. This would be a syntax error due to the malformed XML, but many lines down there is an extra </param> tag, so all is forgiven.

Unfortunately Splunk is strangely tolerant of unexpected tags in the view XML, so it gave you no warning or error when this mistake was made.

The upshot is - indentation is your friend. Although it seems really tedious, keeping your XML properly indented makes it far easier (or at least less impossible) to spot all kinds of mistakes small and large.

And since you're using Sideview Utils already, you might try the Sideview Editor for all your view-editing.

Also, the Sideview Editor can be a useful tool to simply clean up all the indentation at once. In the Sideview Editor select your app and your view, click a module at random to edit it, and then simply submit the form without changing anything. While the configuration of the view will not change, the Editor will take the liberty of cleaning up indentation and linebreaks, pruning and reordering attributes, removing non-semantic whitespace and various things like that.

Note that the Editor will always write to a local directory rather than writing to default so you might have to fish the cleaned-up view out of an unexpected directory and copy it back to default.

View solution in original post

sideview
SplunkTrust
SplunkTrust

This falls under "the perils of editing XML by hand".

When you added the last Pulldown, you have a wayward </param> tag in there, such that the |Time_Span_Selection($timeFilter.label$) Search module, the span Pulldown, and the SubmitButton are all trapped inside the timeFilter Pulldown's staticOptions param.

Look closely and you'll see that after the last staticOption in the timeFilter Pulldown, there is no </param> there. This would be a syntax error due to the malformed XML, but many lines down there is an extra </param> tag, so all is forgiven.

Unfortunately Splunk is strangely tolerant of unexpected tags in the view XML, so it gave you no warning or error when this mistake was made.

The upshot is - indentation is your friend. Although it seems really tedious, keeping your XML properly indented makes it far easier (or at least less impossible) to spot all kinds of mistakes small and large.

And since you're using Sideview Utils already, you might try the Sideview Editor for all your view-editing.

Also, the Sideview Editor can be a useful tool to simply clean up all the indentation at once. In the Sideview Editor select your app and your view, click a module at random to edit it, and then simply submit the form without changing anything. While the configuration of the view will not change, the Editor will take the liberty of cleaning up indentation and linebreaks, pruning and reordering attributes, removing non-semantic whitespace and various things like that.

Note that the Editor will always write to a local directory rather than writing to default so you might have to fish the cleaned-up view out of an unexpected directory and copy it back to default.

keerthana_k
Communicator

I have edited the question to include the xml.

sideview
SplunkTrust
SplunkTrust

Can you post the XML? From what you've described that shouldn't be happening so it must be some other change that was made (maybe inadvertently). I'll be able to spot the problem quickly though. You can also email it to support [at] sideviewapps.com .

0 Karma
Get Updates on the Splunk Community!

.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 ...

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...