/// <inheritDocs />
        public override object GetViewModel(object value, IMetaField metaField)
        {
            this.Value = value;
            var viewModel = new MultipleChoiceFieldViewModel()
            {
                Choices                  = this.DeserializeChoices(),
                Value                    = value,
                MetaField                = this.MetaField,
                HasOtherChoice           = this.HasOtherChoice,
                IsRequired               = this.ValidatorDefinition.Required.HasValue ? this.ValidatorDefinition.Required.Value : false,
                ValidationAttributes     = this.BuildValidationAttributesString(),
                RequiredViolationMessage = this.ValidatorDefinition.RequiredViolationMessage,
                CssClass                 = this.CssClass
            };

            return(viewModel);
        }
Beispiel #2
0
        /// <inheritDocs />
        public override object GetViewModel(object value, IMetaField metaField)
        {
            this.Value = value;
            var viewModel = new MultipleChoiceFieldViewModel()
            {
                Choices                  = this.DeserializeChoices(),
                Value                    = value,
                MetaField                = this.MetaField,
                HasOtherChoice           = this.HasOtherChoice,
                IsRequired               = this.ValidatorDefinition.Required.HasValue ? this.ValidatorDefinition.Required.Value : false,
                ValidationAttributes     = this.BuildValidationAttributesString(),
                RequiredViolationMessage = this.ValidatorDefinition.RequiredViolationMessage,
                CssClass                 = this.CssClass,
                Hidden                   = this.Hidden && (!Sitefinity.Services.SystemManager.IsDesignMode || Sitefinity.Services.SystemManager.IsPreviewMode)
            };

            return(viewModel);
        }
        /// <inheritDocs />
        public override object GetViewModel(object value, IMetaField metaField)
        {
            this.Value = value;
            var viewModel = new MultipleChoiceFieldViewModel()
            {
                Choices = this.DeserializeChoices(),
                Value = value,
                MetaField = this.MetaField,
                HasOtherChoice = this.HasOtherChoice,
                IsRequired = this.ValidatorDefinition.Required.HasValue ? this.ValidatorDefinition.Required.Value : false,
                ValidationAttributes = this.BuildValidationAttributesString(),
                RequiredViolationMessage = this.ValidatorDefinition.RequiredViolationMessage,
                CssClass = this.CssClass
            };

            return viewModel;
        }