public function onBeforeWrite() {
        parent::onBeforeWrite();
        
        if(empty($this->owner->DefaultPreviewMode)) {
            $this->owner->DefaultPreviewMode=Config::inst()->get('UserPreviewPreference', 'DefaultMode');
        }
        
        
        //If changed ensure their is a session message
        if($this->owner->isChanged('DefaultPreviewMode')) {
            Controller::curr()->getRequest()->getSession()->set('ShowPreviewSettingChangeReload', true);
            $this->isSaving=true;
        }
    }