I think the code remains the same however, you set and unset tokens based on which button is being clicked.
You will additionally require "splunkjs/mvc" to use default or submitted token model.
// mvc.Components.get() function to get all default Tokens
var defaultTokenModel = mvc.Components.get("default");
//jQuery to capture Refresh button click event
$('#button1').on("click", function() {
defaultTokenModel.set("button1","true");
//Use EventHandler utiliy to unset Tokens
EventHandler.unsetToken("button2");
EventHandler.unsetToken("button3");
EventHandler.unsetToken("button4");
});
Similarly for other buttons.
Refer to Developer documentation: http://dev.splunk.com/view/webframework-developapps/SP-CAAAEW3
PS: The above code is not tested, so please refer to one of my other answers and Splunk Developer portal to understand the concepts: https://answers.splunk.com/answers/566582/how-to-hide-html-in-panel-when-multiple-tokens-are.html#answer-566628
If it does not work let me know. And if it works dont forget to upvote 🙂
... View more