
Originally Posted by
micgala
PHP Code:
messageBox.getDialog().setFocusWidget(messageBox.getDialog().getButtonBar().getItemByItemId(Dialog.NO));
The problem is that you need to instantiate the MessageBox (and it is normally not used like this, but using the static methods).
Most of the static methods you would call to show a MessageBox (alert, confirm, progress, prompt) do in fact return a MessageBox object, so it's not that bad. In fact, you can even further simplify your snippet of code quite a bit:
PHP Code:
MessageBox alertBox = MessageBox.alert("Alert Box", "Hey, I'm alerting you!", null);
alertBox.getDialog.getButtonById(Dialog.NO).focus();