You can't. The only way is to implement an endpoint so you implement all the logic there, and interact with the on-select-action. Then you return a variable e.g. show_my_variable = true, and then show the dropdown with an if.