You made the statement:
"since the following code seems to enable a modal dialog anyway?
So prove your statement by posting the code you tested that demonstrated this behaviour.
Then we can look at the code to see what you might be doing wrong.
One line of code doesn't help us.
If you want help then start making an effort by posting a proper SSCCE with your questions showing what you have tried and the results that you get.