Implemented demo of cx.onEvent