A common UI situation is that you want to provide a confirmation box to a user. If the user clicks “yes” you want some process to take place and possibly refresh some items on your page.
In my case I wanted to prompt the user if they wanted to delete an item, and if ‘yes’ proceed with the delete and then refresh the item list.
So at first one might thing something like this should work:
The problem here is that the modal messagebox interferes with the message queue and the items refresh BEFORE your confirmation box even takes place. So, after the delete, the items aren’t refreshed. On top of this, even if the above did work as expected (notify of items change AFTER the method exits), you still have a wasted notify change if the user selected “NO.”
The solution as pointed out by hswain and nsharma within this post is to leverage BindUtils.postNotifyChange(…)
My modified code now looks like: