Hi Everyone,
Can anyone please tell me how can I populate other fields in interface based on value selected in one of the dropdown field?
Thank You
Discussion posts and replies are publicly visible
HI ,
Displaying other components in the interface based on the dropdown values depends on the scenario and you can use "showWhen" to control the display of components.
For you reference i have attached a sample code , where based on the selected values you can see the text fields
a!localVariables( local!showWhen, { a!dropdownField( label: "Drop Down", placeholder: "Select a value", choiceLabels: {"Yes","No"}, choiceValues: {"Yes","No"}, value: local!showWhen, saveInto: { local!showWhen } ), a!textField( label: "Filed when value is Yes", showWhen: local!showWhen = "Yes" ), a!textField( label: "Filed when value is No", showWhen: local!showWhen = "No" ) })
Hope this can be helpful
Thanks Satyanarayan,
But I am retreiving the fields from the database using expression rule, and want to populate these fields based on one of the value selected in dropdown filed from the database. Please reply.
HI
Call in the Query rule in a local variable and pass the local variable in the choiceLables and ChoiceValues of the dropDown and use showWhen condition in the fields that you want to populate (like i have used in the example showWhen : local!showWhen = "Yes" )
Thanks,
The drop down field is dynamic and getting values from database. Above solution has some fixed values only.
If possible please share the code , we can understand a bit more.