Dropdown value not reverting after confirmation popup cancel

Hi team,

I have a dropdown embedded inside a table. When the dropdown value changes, I show a confirmation popup. If the user clicks Yes, everything works fine. However, if the user clicks No, the changed value still remains selected in the dropdown, even though the table data is being refreshed via polling every 3 seconds. Only the dropdown value does not revert to the original value.

Does anyone have a quick solution for this issue?

Thanks in advance.

How are you handling the No click?

def runAction(self, event):
	system.perspective.closePopup("confirmToggle")	

You may need to send a message, caught by your table/your dropdown view, to reset it.
Though a refresh of the binding should be enough to reset the value, so there may be something weird happening there.

Also: Why a dropdown for a boolean ? Why not a toggle switch or a checkbox ?

dropdown is for some values this is just close for the popup.
I have tried to refresh table but its is not working.

To expand on this, you need a generic popup takes a parameter, that parameter will probably be the primary key of the row that you clicked on the dropdown. When you handle the yes or no buttons, pass this primary key via message handlers to the dropdowns, which filter for the primary key, and it sets the dropdown selected to null or previous value when triggered by a "No".
Also to note, you can slow down the polling and use the message handlers to trigger a "refreshBinding" on the table binding after a click action.
I find this makes the table respond super rapidly to the user, and minimises polling on the database.

Right sorry, I read yes and no and thought these were the dropdowns values, but they're the confirmation popup buttons

def onMessageReceived(self, payload):

self.getChild("FlexContainer").getChild("Scheduled").getChild("tbl_NEW").refreshBinding("props.data")

on No click i call handler of the page root.
it is not updating the table data.

is some thing i am missing?

If you throw a logger in the message handler, is it getting called?

First, thank you all for your cooperation.
I was able to resolve this by creating a message handler in the dropdown’s view and simply resetting the dropdown value.

self.getChild("Dropdown").props.value = self.view.params.value

This updates the dropdown with the current value, where view.params.value holds the actual (original) value.

1 Like