add support for onBeforeChange in page to prevent a page change