This should go in `onRender` since the handler depends on UI elements to be rendered.