<panel depends="show_panel">
<title>xyz</title>
<search base="main_base">
<progress>
<condition>
<set token="show_panel">true</set>
<condition>
<condition>
<unset token="show_panel"></unset>
<condition>
</progress>
<query> | search months="$tok_mon$" </query>
</search>
</panel>
can anyone explain what the above xml code is doing with the token show_panel and what the progress Tag is doing or does?
this is a drilldown xml code .
Probably not what you are expecting!
When the first condition is satisfied (since this is empty, it will always be satisfied), the token is set to true. The second condition is never evaluated
Apart from this, there are a number of other errors in the xml you posted - the depends need $ around the token name, the condition tags are not properly closed, for example.
If you wanted the panel to appear once the search is complete, you could do something like this
<panel depends="$show_panel$">
<title>xyz</title>
<search base="main_base">
<done>
<condition>
<set token="show_panel">true</set>
</condition>
</done>
<progress>
<condition>
<unset token="show_panel"></unset>
</condition>
</progress>
<query> | search months="$tok_mon$" </query>
</search>
</panel>
Probably not what you are expecting!
When the first condition is satisfied (since this is empty, it will always be satisfied), the token is set to true. The second condition is never evaluated
Apart from this, there are a number of other errors in the xml you posted - the depends need $ around the token name, the condition tags are not properly closed, for example.
If you wanted the panel to appear once the search is complete, you could do something like this
<panel depends="$show_panel$">
<title>xyz</title>
<search base="main_base">
<done>
<condition>
<set token="show_panel">true</set>
</condition>
</done>
<progress>
<condition>
<unset token="show_panel"></unset>
</condition>
</progress>
<query> | search months="$tok_mon$" </query>
</search>
</panel>
when does the token get unset inside the progress tag? is it at the end of the search or when it is ongoing?
Ongoing - $job.resultcount$ is updated during the search, so you can use that in your conditions too, if that helps
<row>
<panel depends="$show_panel2$">
<chart>
<search base="main_base">
<progress><condition>
<set token="show_panel2">true</set>
</condition>
</progress>
<query>| search date="$tok_mon$"</query>
</search>
</chart>
</panel>
</row>
in the above case if i the token $tok_mon$ is not initialized and the search will be stuck at waiting for input but still it's not showing the panel.
I am not sure what the purpose of this example is - if you want the panel to show even when it is waiting for input and when it is performing the search, just remove the depends?
if the search is stuck in 'waiting for input' state then the progress tab will not run the condition and set the token you mean?
As stated by you earlier that it will always be true so show_panel2 should be true also for the above code?
Sorry I'm getting confused.
The search apparently isn't in progress because it hasn't started due to the missing input.
What I meant earlier was that within the progress handler, the conditions are processed in order, and since the first one has no condition to evaluate, it will always evaluate to true so it will be the only one to be evaluated and the second condition is never reached. This is predicated on there being progress in the first place.