As the previous comment, this should be done in `onBeforeShow`.