Implement method generator for 'onAction' listener