Hi there,I have a scenario where there is a dropdown, whose value is getting saved in a local!var.
Now, upon selection a specific option from the single select dropdown, depending upon the value, there is another child interface which is consuming the selected local value in its ri!var throuhg which the charts are being generated.Now, If we select the value, the chart is generated rendering from the child interface.If we deselect the selected value, the chart is not getting back to the original state.I.e, it is not being selectec on deselection of a value from the dropwdown.
My goal is upon the deselection of the value, the chart should be back to its normal state, means the refresh case should be working.Any thoughts upon this?
Discussion posts and replies are publicly visible
Stefan Helzle
Can we see the current code. How the data is passed to child interface (Charts). are you querying it on data parameter or querying it in local variable and passing it.Without code, only thing we can say is it's because refresh behavior. try using Refreshvariable on var change in data that passed to Charts
I am missing all relevant details.
a!localVariables( local!dropdownVal, { a!dropdownField( choiceLabels: { "1", "2", "3", "4", "5" }, choiceValues: { 1, 2, 3, 4, 5 }, value: local!dropdownVal, saveInto: local!dropdownVal, placeholder: "Test" ), rule!S_Test_Chart(val: local!dropdownVal) } )
Stefan Helzle , Please refer to this example code.
If I select a value in the dropdown field, the local local!dropdownVal will be updated.
Now, If I deselect the selected value by clicking on Placeholder i.e "Test", the value of the variable will become null again.
In line 11, by default the chart is showing all customers, and when the user selected a value, it will show a specific customer chart.
The problem is, when the initial value is being selected, the chart is generated in rule call at line 11 based upon the dropdown selection i.e the specific customer chart.
If, the value is null back again, the chart is no showing the original version as it was by default.After value being null, there is a problem of referesh.
Please refer to the above example code:
If the value is being selected in the dropdown, the rule at line 11 will genereate the chart.If the value is being deselcted, means the dropdown will have the null vale for the local!dropdownVal, then the chart will not be refreshed with the null value for it. Stefan Helzle
hi saifalikhan13 i think you need to handle the null condition in this case because if you are deselecting it means the variable might be null. trying using some null condition logic
We need to drill deeper.
saifalikhan13 said:After value being null, there is a problem of referesh.
What exactly does this mean?
It means, if you want to deselect the selected value from the dropdown, you can click on the dropdown and click on the placeholder name, the local variable holding the value will be back to null.
Yeah, I know how to deselect a dropdown. But what exactly goes wrong when doing this?