Perhaps a bit similar, I worked on a desktop application that might throw several warning messages when saving a record. What I did was, when clicking the save button, to check if any of those warning messages popup appeared, if so, I will pre-program which button to click (e.g. ok, cancel, close). If I try to continue the saving action, I will then check again for any other popup error message being displayed.
However, I wrote all of the above logic into the Object, which I think is wrong as there should not be any logic in the Object.... any suggestions?