Hi all,
This is change condition in 3 inputs
<change>
<condition label="Any">
<set token="flag_1">0</set>
</condition>
<condition>
<set token="flag_1">1</set>
<set token="showDetails">true</set>
</condition>
</change>
<change>
<condition label="Any">
<set token="flag_2">0</set>
</condition>
<condition>
<set token="flag_2">1</set>
<set token="showDetails">true</set>
</condition>
</change>
<change>
<condition label="Any">
<set token="flag_3">0</set>
</condition>
<condition>
<set token="flag_3">1</set>
<set token="showDetails">true</set>
</condition>
</change>
This is the drilldown token for setting "showDetails" to "true" to display another table:
<drilldown>
<condition field="RuleID">
<set token="form.ruleID_tok">$click.value2$</set>
<set token="flag_1">1</set>
<set token="showDetails">true</set>
</condition>
<condition field="RuleDescription">
<set token="form.ruleDescription_tok">$click.value2$</set>
<set token="flag_2">1</set>
<set token="showDetails">true</set>
</condition>
<condition field="RuleLevel">
<set token="form.ruleLevel_tok">$click.value2$</set>
<set token="flag_3">1</set>
<set token="showDetails">true</set>
</condition>
</drilldown>
And now, I want to unset showDetails when (flag_1, flag_2, flag_3) = 0. To hide the table depends on showDetails token.
Thank you, but I don't know how to use it. Btw, I solved the problem with ton of logic <done> and <condition> tag.
@lnn2204 - I think in this case you need to use JavaScript.
require([
'jquery',
'splunkjs/mvc',
'splunkjs/mvc/simplexml/ready!'
], function ($, mvc) {
let submittedTokens = mvc.Components.getInstance('submitted');
let defaultTokens = mvc.Components.getInstance('default');
function processShowDetails(){
let flag_1 = submittedTokens.get("flag_1");
let flag_2 = submittedTokens.get("flag_2");
let flag_3 = submittedTokens.get("flag_3");
if(flag_1=="0" && flag_2=="0" && flag_3=="0"){
submittedTokens.unset("showDetails");
defaultTokens.unset("showDetails");
}
}
submittedTokens.on("change:flag_1", processShowDetails);
submittedTokens.on("change:flag_2", processShowDetails);
submittedTokens.on("change:flag_3", processShowDetails);
});
Kindly ignore typos.
I hope this helps!!!
Thank you, but I don't know how to use it. Btw, I solved the problem with ton of logic <done> and <condition> tag.
Can you please share dashboard's sample XML to get some idea about the inputs and the dependent panels. ?
KV
This is the input
<fieldset submitButton="false">
<input type="time" token="allDashboard_time_tok" searchWhenChanged="true">
<label>Time's Range</label>
<default>
<earliest>-24h@h</earliest>
<latest>now</latest>
</default>
</input>
<input type="dropdown" token="ruleID_tok" searchWhenChanged="true">
<label>Rule's ID</label>
<choice value="*">Any</choice>
<fieldForLabel>RuleID</fieldForLabel>
<fieldForValue>RuleID</fieldForValue>
<search base="Base">
<query>fields RuleID | top 0 RuleID | sort + RuleID</query>
</search>
<default>*</default>
<initialValue>*</initialValue>
<change>
<condition label="Any">
<set token="flag_1">0</set>
</condition>
<condition>
<set token="flag_1">1</set>
<set token="showDetails">true</set>
</condition>
</change>
</input>
<input type="dropdown" token="ruleDescription_tok" searchWhenChanged="true">
<label>Rule's Description</label>
<choice value="*">Any</choice>
<default>*</default>
<initialValue>*</initialValue>
<fieldForLabel>RuleDescription</fieldForLabel>
<fieldForValue>RuleDescription</fieldForValue>
<search base="Base">
<query>fields RuleDescription | top 0 RuleDescription | sort + RuleDescription</query>
</search>
<change>
<condition label="Any">
<set token="flag_2">0</set>
</condition>
<condition>
<set token="flag_2">1</set>
<set token="showDetails">true</set>
</condition>
</change>
</input>
<input type="dropdown" token="ruleLevel_tok" searchWhenChanged="true">
<label>Rule's Level</label>
<choice value="*">Any</choice>
<default>*</default>
<initialValue>*</initialValue>
<fieldForLabel>RuleLevel</fieldForLabel>
<fieldForValue>RuleLevel</fieldForValue>
<search base="Base">
<query>fields RuleLevel | top 0 RuleLevel | sort + RuleLevel</query>
</search>
<change>
<condition label="Any">
<set token="flag_3">0</set>
</condition>
<condition>
<set token="flag_3">1</set>
<set token="showDetails">true</set>
</condition>
</change>
</input>
</fieldset>