I created a dashboard with 5 dropdowns
I passed values of 4 dropdowns in the 5th.. the macro given in is working fine , but the macro given as value="" is not expanding.. can anyone help me with this
Here is my code..
<form>
<fieldset submitButton="false">
<input type="radio" token="val1" searchWhenChanged="true"></input>
<input type="radio" token="val2" searchWhenChanged="true"></input>
<input type="radio" token="val3" searchWhenChanged="true"></input>
<input type="radio" token="val4" searchWhenChanged="true"></input>
<input type="radio" token="val4" searchWhenChanged="true">
<choice value="`macro1($val1$,$val2$,$val3$,$val4$)`">yes</choice> //not working
<choice value="`macro2($val1$,$val2$,$val3$,$val4$)`">no</choice> //not working
<default>`macro2($val1$,$val2$,$val3$,$val4$)`</default> //working
</input>
</fieldset>
<row>
<table>
<search>
<query>$type$ ...</query></search></table></row>
</form>
While your question seems to have truncated, macro will be accepting strings as argument, hence you should try to change to the following:
`macro1("$val1$","$val2$","$val3$","$val4$")`
`macro2("$val1$","$val2$","$val3$","$val4$")`
Please try out putting the tokens under double quotes when you pass to macro and it should work. Let us know if it does not.
Tried!!!... not working
Change the value for val4 radio to yes
and no
, based on corresponding selected choice.
Then code the change event to set the macro token callMacro
which can be used in your search query. In your case value for choice is considering token as string hence not replacing its actual token value. Please try out the following code and let us know. (PS two of your inputs were val4. I have converted one to val5).
<fieldset submitButton="false">
<input type="radio" token="val1" searchWhenChanged="true"></input>
<input type="radio" token="val2" searchWhenChanged="true"></input>
<input type="radio" token="val3" searchWhenChanged="true"></input>
<input type="radio" token="val4" searchWhenChanged="true"></input>
<input type="radio" token="val5" searchWhenChanged="true">
<choice value="yes">yes</choice> //not working
<choice value="no">no</choice> //not working
<default>no</default> //working
<change>
<condition value="yes">
<set token="callMacro">`macro1("$val1$","$val2$","$val3$","$val4$")`</set>
</condition>
<!-- Else or default condition, will be hit when choice is No-->
<condition>
<set token="callMacro">`macro2("$val1$","$val2$","$val3$","$val4$")`</set>
</condition>
</change>
</input>
</fieldset>
I get the output,but not the expected result
@niventhainspire_07, You have used just the code for val5 right?
I would say that the code should work, if there is an issue with macro you would need to fix yourself or provide the details of macro here.
If you want to test whether the tokens for val1...val4 are being set up properly, you can use the following
<change>
<set token="callMacro">val1:$val1$, val2:$val2$, val3:$val3$, val4:$val4$</set>
</change>
</input>
</fieldset>
<row>
<panel>
<title>$callMacro$</title>
</panel>
</row>