Interesting. Didn't know about the convenient way to attach a handler to a dialog element. Seems a good choice for this use case