Pass 'this' as the scope argument on the event handler listen instead of using self here. It may also be worth moving this out into a 'save' function of the dialog so that you can programmatically call it from other places (like if the user hits enter or something).