I am receiving from a Redirector with the help of URLLoader few parameters. One of them I would like to use in the StaticFieldsToDisplay of the Pulldown module, but I can not achieve that.
In the example bellow the pulldown shows : $passdownClicked$ , but on the other hand the HTML component displays the correct value.
<module name="URLLoader" layoutPanel="panel_row1_col1" autoRun="True">
<module name="ValueSetter">
<param name="name">passdownClicked</param>
<param name="value">$clicked$</param>
<module name="Search">
<param name="search">index=test $dbs$ | stats count by Server</param>
<param name="earliest">$earliest$</param>
<param name="latest">$latest$</param>
<module name="TimeRangePicker">
<param name="searchWhenChanged">True</param>
<module name="Pulldown">
<param name="name">Server</param>
<param name="label">Server</param>
<param name="postProcess">dedup $name$ | sort $name$</param>
<param name="staticFieldsToDisplay">
<list>
<param name="value">$passdownClicked$</param>
<param name="label">$passdownClicked$</param>
</list>
</param>
<param name="searchFieldsToDisplay">
<list>
<param name="value">Server</param>
<param name="label">Server</param>
</list>
</param>
<param name="template">Server="$value$"</param>
<module name="Search">
<module name="HTML">
<param name="html">The passed down value $passdownClicked$</param>
</module>
OK. So you want to prepopulate the Pulldown using an argument from the URLLoader. No problem.
There's an example in Sideview Utils about this (see the 'linking' section), but I've been meaning to give it some friends and expand on it a bit more. For now you can see the three examples of how that page links to other pages and how the prepopulation works there in the target pages.
The main change you have to make is dont call the argument 'clicked'. I know you're trying to make it simpler but just call it whatever the name
of your Pulldown is and you'll be back on the right track. You do not need ValueSetter at all. All you have to do is have a key like 'foo=12' in the URL, URLLoader will make that key value pair available downstream, and if there's a Pulldown or TextField whose name
param is 'foo', it will prepopulate.
Some more notes:
The end result
<module name="URLLoader" layoutPanel="panel_row1_col1" autoRun="True">
<module name="TimeRangePicker">
<!-- this Search just feeds the Pulldown -->
<module name="Search">
<param name="search">index=test $dbs$ | stats count by Server</param>
<module name="Pulldown">
<param name="name">Server</param>
<param name="template">Server="$value$"</param>
<param name="label">Server</param>
<param name="postProcess">dedup $name$ | sort $name$</param>
<param name="searchFieldsToDisplay">
<list>
<param name="value">$name$</param>
</list>
</param>
<module name="Search">
<param name="search">index=test $dbs$ $Server$</param>
<module name="HTML">
<param name="html">The passed down value is $Server$</param>
</module>
Again, the main change is that the parameter in the URL should be Server=something, not clicked=something. If for some reason the value has to be different, you could patch it with a ValueSetter to convert the 'clicked' key to a 'Server' key but that would be an extra step. It's way easier to just make the names match up.
I recommend taking another pass reading through the relevant examples in the Sideview Utils docs, and I will make a note to improve the examples here for clarity and completeness.
OK. So you want to prepopulate the Pulldown using an argument from the URLLoader. No problem.
There's an example in Sideview Utils about this (see the 'linking' section), but I've been meaning to give it some friends and expand on it a bit more. For now you can see the three examples of how that page links to other pages and how the prepopulation works there in the target pages.
The main change you have to make is dont call the argument 'clicked'. I know you're trying to make it simpler but just call it whatever the name
of your Pulldown is and you'll be back on the right track. You do not need ValueSetter at all. All you have to do is have a key like 'foo=12' in the URL, URLLoader will make that key value pair available downstream, and if there's a Pulldown or TextField whose name
param is 'foo', it will prepopulate.
Some more notes:
The end result
<module name="URLLoader" layoutPanel="panel_row1_col1" autoRun="True">
<module name="TimeRangePicker">
<!-- this Search just feeds the Pulldown -->
<module name="Search">
<param name="search">index=test $dbs$ | stats count by Server</param>
<module name="Pulldown">
<param name="name">Server</param>
<param name="template">Server="$value$"</param>
<param name="label">Server</param>
<param name="postProcess">dedup $name$ | sort $name$</param>
<param name="searchFieldsToDisplay">
<list>
<param name="value">$name$</param>
</list>
</param>
<module name="Search">
<param name="search">index=test $dbs$ $Server$</param>
<module name="HTML">
<param name="html">The passed down value is $Server$</param>
</module>
Again, the main change is that the parameter in the URL should be Server=something, not clicked=something. If for some reason the value has to be different, you could patch it with a ValueSetter to convert the 'clicked' key to a 'Server' key but that would be an extra step. It's way easier to just make the names match up.
I recommend taking another pass reading through the relevant examples in the Sideview Utils docs, and I will make a note to improve the examples here for clarity and completeness.