I am using SmartGWT4.1 power edition. When a user selects a specific value in SelectItem, I need to ask whether he really wants the change. If the answer is no, I need to revert to previous value. I am using ChangeEvent.cancel(), but the previous value in SelectItem is not restored.
Announcement
Collapse
No announcement yet.
X
-
If you're doing something like using isc.ask() to find out if the user wants to cancel the change, that's an asynchronous approach, and it's too late to use ChangeEvent.cancel() once the user answers the dialog. Instead, you could capture the current value in the SelectItem using getValue(), and apply it via setValue() if the user chooses to revert.
Comment