public override void Fill(RadioButtonListPropertyBag propertyBag, FillerParams fillerParams) { //Filling implementation code if (fillerParams.OverrideSettings != null && fillerParams.OverrideSettings.Count > 0) { propertyBag.TabIndex = Convert.ToInt16(fillerParams.OverrideSettings[ControlLibConstants.TAB_INDEX]); propertyBag.IsVerticalAllign = Convert.ToBoolean(fillerParams.OverrideSettings[ControlLibConstants.IS_VERTICAL_ALLIGN]); propertyBag.ListDisplayLength = Convert.ToInt16(fillerParams.OverrideSettings[ControlLibConstants.LIST_LENGTH]); propertyBag.OnClickFunction = fillerParams.OverrideSettings[ControlLibConstants.ON_CLICK_FUNCTION]; propertyBag.ListItem = ControlHelper.GetOptions(fillerParams.List, fillerParams.ValueMember, fillerParams.DisplayMember, fillerParams.OverrideSettings[ControlLibConstants.SELECTED_VALUE], fillerParams.Disabled); if (propertyBag.Style == null && (fillerParams.OverrideSettings.Keys.Contains(ControlLibConstants.WIDTH) || fillerParams.OverrideSettings.Keys.Contains(ControlLibConstants.HEIGHT))) { propertyBag.Style = new StylePropertyBag(); } if (propertyBag.Style != null) { propertyBag.Style.Width = fillerParams.OverrideSettings.Keys.Contains(ControlLibConstants.WIDTH) ? fillerParams.OverrideSettings[ControlLibConstants.WIDTH] : string.Empty; propertyBag.Style.Height = fillerParams.OverrideSettings.Keys.Contains(ControlLibConstants.HEIGHT) ? fillerParams.OverrideSettings[ControlLibConstants.HEIGHT] : string.Empty; } if (fillerParams.OverrideSettings[ControlLibConstants.CSS_CLASS] != string.Empty) { propertyBag.CssClass = fillerParams.OverrideSettings[ControlLibConstants.CSS_CLASS]; } } propertyBag.ReadOnly = fillerParams.IsReadOnly.HasValue ? fillerParams.IsReadOnly.Value : propertyBag.ReadOnly; propertyBag.Enabled = fillerParams.IsEnabled.HasValue ? fillerParams.IsEnabled.Value : propertyBag.Enabled; SetVisibility(propertyBag, fillerParams); }
public override void Fill(RadioButtonListPropertyBag propertyBag, FillerParams fillerParams) { if (fillerParams.SkipSecurityFill == false) { IModelPropertyConfiguration propertyConfig = ReadPropertyConfiguration(fillerParams.ModelName, fillerParams.PropertyName, fillerParams.ConfigKey); if (propertyConfig != null) { IAccessPolicy accessSecurity = GetAccess(propertyConfig.PropertyConfiguration.Security); if (accessSecurity != null) { propertyBag.Enabled = accessSecurity.Enabled; propertyBag.ReadOnly = accessSecurity.ReadOnly; propertyBag.Visibility = accessSecurity.Visibility; } } else { setDefalutSecurity(propertyBag); } } else { setDefalutSecurity(propertyBag); } }
public override void Fill(RadioButtonListPropertyBag propertyBag, FillerParams fillerParam) { propertyBag.ControlName = fillerParam.ControlName; IControlDefaultPropertyBag controlDefault = ReadDefaultConfiguration(ControlNames.BallyRadioButtonList); if (controlDefault != null) { propertyBag.CssClass = controlDefault.CssClass; propertyBag.ValidationErrorCssClass = controlDefault.ValidationErrorCssClass; propertyBag.ControlErrorCssClass = controlDefault.ControlErrorCssClass; } }
public static MvcHtmlString BallyRadioButtonList <TModel, TProperty>(this HtmlHelper <TModel> htmlHelper, Expression <Func <TModel, TProperty> > expression, ItemDataSource dataSource, int listLength = -1, string[] disabled = null, StylePropertyBag style = null, short tabIndex = 0, string onClickFunction = "", bool isVerticalAllign = false, string cssClass = "") { string propertyName = string.Empty; string modelName = string.Empty; object value = string.Empty; string errMsg = string.Empty; string chkBoxListHTMLString = string.Empty; string configKey = string.Empty; Dictionary <string, string> overrideSettings; RadioButtonListHTMLEmitter radioListHTMLEmitter; ControlExtension.GetPropertyNameAndValue <TModel, TProperty>(htmlHelper, expression, out propertyName, out modelName, out value, out errMsg, out configKey); overrideSettings = GetBallyRadioButtonListOverrideSettings(listLength, style, tabIndex, onClickFunction, isVerticalAllign, value, cssClass); FillerParams fillerParams = null; if (dataSource != null) { fillerParams = new FillerParams(modelName, propertyName, overrideSettings, list: dataSource.DataSource, valueMember: dataSource.ValueMember, displayMember: dataSource.DisplayMember, configKey: configKey); } else { fillerParams = new FillerParams(modelName, propertyName, overrideSettings, list: null, valueMember: string.Empty, displayMember: string.Empty, configKey: configKey); } var fillers = ControlPropertyFillerFactory.Get(); var chkListpropertyBag = new RadioButtonListPropertyBag(fillerParams); chkListpropertyBag.Accept(fillers); chkListpropertyBag.ErrorMessage = errMsg; chkListpropertyBag.IsDirty = string.IsNullOrEmpty(errMsg) ? false : true; radioListHTMLEmitter = new RadioButtonListHTMLEmitter(value != null ? value.ToString() : string.Empty, chkListpropertyBag); radioListHTMLEmitter.Emit(out chkBoxListHTMLString); return(MvcHtmlString.Create(chkBoxListHTMLString)); }
public override void Fill(RadioButtonListPropertyBag propertyBag, FillerParams fillerParams) { fillValidators(propertyBag, fillerParams); }
public RadioButtonListHTMLEmitter(string value, RadioButtonListPropertyBag propertyBag) : base(propertyBag.Validators, propertyBag.Mandatory) { this._propertyBag = propertyBag; this.Value = value; }
public virtual void Fill(RadioButtonListPropertyBag propertyBag, FillerParams fillerParams) { }