All Apps and Add-ons

Table is being reloaded before button is pressed

cmak
Contributor

I have a form of 5 pulldowns modules, which are populated by 2 sets of searches.
The first two are populated by the first search, then post process. Same with the last 3.

I have a button at the bottom, above a table module.
When I click the last 3 pulldowns, the table does not change until I press the button. This is the behavior that I want.

However, when I click any of the top 2 pulldowns, my table disappears. A new one does not show up until I click the button however.

I would like my table not to disappear until I click the button

1 Solution

sideview
SplunkTrust
SplunkTrust

Ah, That's an interesting bug because it's actually a problem in the module framework itself, which doesn't happen very often. The framework assumes that a search dispatched at point X, effectively makes the state of all downstream modules stale, so it calls reset() on all of them, even if some are way way downstream and even if they wont be actually rendering anything directly from the search that was dispatched. Since the Table module implements reset() just like all modules should, that's what gives you your bug.

I'll take a look at it and see if it's feasible to modify this at the proper level as a patch from Sideview Utils.

In the meantime though, you can use this pretty simple customBehavior and it will give you the behavior you want. Be careful what Table's in what views you apply this customBehavior to, because simply turning off the reset method will do things that you'll agree are bugs elsewhere.

Put this in application.js:

Sideview.utils.declareCustomBehavior("turnOffReset", function(tableModule) {
    tableModule.reset = function() {}
});

and then add this param to your Table module.

<param name="customBehavior">turnOffReset</param>

and that'll do it.

View solution in original post

sideview
SplunkTrust
SplunkTrust

Ah, That's an interesting bug because it's actually a problem in the module framework itself, which doesn't happen very often. The framework assumes that a search dispatched at point X, effectively makes the state of all downstream modules stale, so it calls reset() on all of them, even if some are way way downstream and even if they wont be actually rendering anything directly from the search that was dispatched. Since the Table module implements reset() just like all modules should, that's what gives you your bug.

I'll take a look at it and see if it's feasible to modify this at the proper level as a patch from Sideview Utils.

In the meantime though, you can use this pretty simple customBehavior and it will give you the behavior you want. Be careful what Table's in what views you apply this customBehavior to, because simply turning off the reset method will do things that you'll agree are bugs elsewhere.

Put this in application.js:

Sideview.utils.declareCustomBehavior("turnOffReset", function(tableModule) {
    tableModule.reset = function() {}
});

and then add this param to your Table module.

<param name="customBehavior">turnOffReset</param>

and that'll do it.

sideview
SplunkTrust
SplunkTrust

Yea I guess I ran into this some months ago in another area because I filed something against myself already to investigate making the framework not call reset() on all these deep modules. I'll definitely take a look and try to fix it at the framework level.

0 Karma

cmak
Contributor

Seems kind of hacky, but it does the trick.

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