Hi @niketnilay,
Here is my xml and js respectively. I have used your xml and js file.
Followed this answer: https://answers.splunk.com/answers/581652/how-can-i-create-a-button-switcher.html
I have created a hidden filed which gets populated with button click action. panel "Summary" depends on this field for the submit button functionality.
<form script="srch_btn.js">
<label>Dashboard with multiple input panels and Submit</label>
<fieldset submitButton="false"></fieldset>
<row>
<panel>
<input type="text" token="tokSearchOne">
<label>Search One</label>
</input>
<input type="text" token="tokSearchTwo">
<label>Search Two</label>
</input>
<input type="dropdown" token="tokAppFilter">
<label>App</label>
</input>
<input type="time" token="field6">
<label></label>
<default>
<earliest>-24h@h</earliest>
<latest>now</latest>
</default>
</input>
<input type="time" token="field6">
<label></label>
<default>
<earliest>-7d@h</earliest>
<latest>now</latest>
</default>
</input>
<input depends="$hidden$" type="text" token="searchbtn">
<label>searchbtn</label>
<html>
<button id="srch_btn" class="btn-primary">Search</button>
</html>
</panel>
</row>
<row>
<panel depends="$toksearchone$,$tokSearchTwo$,$tokAppFilter$,$searchbtn$">
<title>summary</title>
<table>
<search>
<query>index=_internal | head 1</query>
<earliest>$field6.earliest$</earliest>
<latest>$field6.latest$</latest>
</search>
</table>
</panel>
</row>
</form>
my "srch_btn.js" code:
require([
"splunkjs/mvc",
"splunkjs/mvc/simplexml/ready!"
], function(
mvc
) {
var defaultTokenModel = mvc.Components.get("default");
var submittedTokenModel = mvc.Components.get("submitted");
$("#srch_btn").click(function(){
defaultTokenModel.set("searchbtn","true");
submittedTokenModel.set("searchbtn","true");
});
});
This has worked properly last Friday. Now, my hidden field is not getting populated as a result Summary panel is waiting on this.
I have used completely wrong JS code (wrong keywords) in order to see the errors. But, nothing is happening after button click.
Do you see any code mistake?
Thank you.
... View more