CreateChildControls() public static method

Creates the child controls and handles adding the required field validator control.
public static CreateChildControls ( IRockControl rockControl, System.Web.UI.ControlCollection controls ) : void
rockControl IRockControl The rock control.
controls System.Web.UI.ControlCollection The controls.
return void
Example #1
0
        /// <summary>
        /// Called by the ASP.NET page framework to notify server controls that use composition-based implementation to create any child controls they contain in preparation for posting back or rendering.
        /// </summary>
        protected override void CreateChildControls()
        {
            base.CreateChildControls();
            Controls.Clear();
            RockControlHelper.CreateChildControls(this, Controls);

            _hfDisableVrm       = new HiddenField();
            _hfDisableVrm.ID    = this.ID + "_dvrm";
            _hfDisableVrm.Value = "True";
            Controls.Add(_hfDisableVrm);

            _hfInCodeEditorMode          = new HiddenFieldWithClass();
            _hfInCodeEditorMode.CssClass = "js-incodeeditormode";
            _hfInCodeEditorMode.ID       = this.ID + "_hfInCodeEditorMode";
            Controls.Add(_hfInCodeEditorMode);

            _ceEditor            = new CodeEditor();
            _ceEditor.ID         = this.ID + "_codeEditor";
            _ceEditor.EditorMode = CodeEditorMode.Lava;
            if (!string.IsNullOrEmpty(this.CallbackOnChangeScript))
            {
                _ceEditor.OnChangeScript = this.CallbackOnChangeScript;
            }

            Controls.Add(_ceEditor);
        }
Example #2
0
        /// <summary>
        /// Called by the ASP.NET page framework to notify server controls that use composition-based implementation to create any child controls they contain in preparation for posting back or rendering.
        /// </summary>
        protected override void CreateChildControls()
        {
            base.CreateChildControls();
            Controls.Clear();
            RockControlHelper.CreateChildControls(this, Controls);

            _divControl = new HtmlGenericControl("div");
            _divControl.Attributes["class"] = "btn-group " + this.FormGroupCssClass;
            _divControl.ClientIDMode        = ClientIDMode.Static;
            _divControl.ID = string.Format("ButtonDropDown_{0}", this.ID);

            _hfSelectedItemId = new HiddenField();
            _hfSelectedItemId.ClientIDMode = ClientIDMode.Static;
            _hfSelectedItemId.ID           = string.Format("hfSelectedItemId_{0}", this.ID);

            _btnSelect = new HtmlGenericControl("button");
            _divControl.Controls.Add(_btnSelect);
            _btnSelect.ClientIDMode              = ClientIDMode.Static;
            _btnSelect.ID                        = string.Format("ButtonDropDown_btn_{0}", this.ID);
            _btnSelect.Attributes["type"]        = "button";
            _btnSelect.Attributes["class"]       = "btn btn-default dropdown-toggle " + this.CssClass;
            _btnSelect.Attributes["data-toggle"] = "dropdown";

            _listControl = new HtmlGenericControl("ul");
            _divControl.Controls.Add(_listControl);
            _listControl.Attributes["class"] = "dropdown-menu";

            Controls.Add(_divControl);
            Controls.Add(_hfSelectedItemId);

            RequiredFieldValidator.InitialValue      = string.Empty;
            RequiredFieldValidator.ControlToValidate = _hfSelectedItemId.ID;
        }
Example #3
0
        /// <summary>
        /// Called by the ASP.NET page framework to notify server controls that use composition-based implementation to create any child controls they contain in preparation for posting back or rendering.
        /// </summary>
        protected override void CreateChildControls()
        {
            base.CreateChildControls();
            Controls.Clear();
            RockControlHelper.CreateChildControls(this, Controls);

            monthDropDownList                       = new DropDownList();
            monthDropDownList.CssClass              = "form-control input-width-sm";
            monthDropDownList.ID                    = "monthDropDownList_" + this.ID;
            monthDropDownList.SelectedIndexChanged += dateList_SelectedIndexChanged;

            dayDropDownList                       = new DropDownList();
            dayDropDownList.CssClass              = "form-control input-width-sm";
            dayDropDownList.ID                    = "dayDropDownList_" + this.ID;
            dayDropDownList.SelectedIndexChanged += dateList_SelectedIndexChanged;

            yearDropDownList                       = new DropDownList();
            yearDropDownList.CssClass              = "form-control input-width-sm";
            yearDropDownList.ID                    = "yearDropDownList_" + this.ID;
            yearDropDownList.SelectedIndexChanged += dateList_SelectedIndexChanged;

            Controls.Add(monthDropDownList);
            Controls.Add(dayDropDownList);
            Controls.Add(yearDropDownList);

            PopulateDropDowns();
        }
Example #4
0
        /// <summary>
        /// Called by the ASP.NET page framework to notify server controls that use composition-based implementation to create any child controls they contain in preparation for posting back or rendering.
        /// </summary>
        protected override void CreateChildControls()
        {
            base.CreateChildControls();
            Controls.Clear();
            RockControlHelper.CreateChildControls(this, Controls);

            Controls.Add(_hfBinaryFileId);
            _hfBinaryFileId.ID    = this.ID + "_hfBinaryFileId";
            _hfBinaryFileId.Value = "0";

            Controls.Add(_hfBinaryFileTypeGuid);
            _hfBinaryFileTypeGuid.ID = this.ID + "_hfBinaryFileTypeGuid";

            _aFileName = new HtmlAnchor();
            Controls.Add(_aFileName);
            _aFileName.ID     = "fn";
            _aFileName.Target = "_blank";
            _aFileName.AddCssClass("file-link");

            _aRemove = new HtmlAnchor();
            Controls.Add(_aRemove);
            _aRemove.ID                  = "rmv";
            _aRemove.HRef                = "#";
            _aRemove.InnerHtml           = "<i class='fa fa-times'></i>";
            _aRemove.Attributes["class"] = "remove-file";

            _fileUpload = new FileUpload();
            Controls.Add(_fileUpload);
            _fileUpload.ID = this.ID + "_fu";

            RequiredFieldValidator.InitialValue      = "0";
            RequiredFieldValidator.ControlToValidate = _hfBinaryFileId.ID;
            RequiredFieldValidator.Display           = ValidatorDisplay.Dynamic;
        }
Example #5
0
        /// <summary>
        /// Called by the ASP.NET page framework to notify server controls that use composition-based implementation to create any child controls they contain in preparation for posting back or rendering.
        /// </summary>
        protected override void CreateChildControls()
        {
            base.CreateChildControls();
            Controls.Clear();
            RockControlHelper.CreateChildControls(this, Controls);

            _hfMin          = new HiddenFieldWithClass();
            _hfMin.ID       = string.Format("{0}_hfMin", this.ID);
            _hfMin.CssClass = "js-number-up-down-min";
            _hfMin.Value    = int.MinValue.ToString();
            Controls.Add(_hfMin);

            _hfMax          = new HiddenFieldWithClass();
            _hfMax.ID       = string.Format("{0}_hfMax", this.ID);
            _hfMax.CssClass = "js-number-up-down-max";
            _hfMax.Value    = int.MaxValue.ToString();
            Controls.Add(_hfMax);

            _hfNumber          = new HiddenFieldWithClass();
            _hfNumber.ID       = string.Format("{0}_hfNumber", this.ID);
            _hfNumber.CssClass = "js-number-up-down-value";
            _hfNumber.Value    = "0";
            Controls.Add(_hfNumber);

            _lblNumber    = new Label();
            _lblNumber.ID = string.Format("{0}_lblNumber", this.ID);
            Controls.Add(_lblNumber);

            RequiredFieldValidator.InitialValue      = string.Empty;
            RequiredFieldValidator.ControlToValidate = _hfNumber.ID;
        }
        /// <summary>
        /// Called by the ASP.NET page framework to notify server controls that use composition-based implementation to create any child controls they contain in preparation for posting back or rendering.
        /// </summary>
        protected override void CreateChildControls()
        {
            base.CreateChildControls();
            Controls.Clear();
            RockControlHelper.CreateChildControls(this, Controls);

            _date    = new TextBox();
            _date.ID = "tbDate";
            _date.AddCssClass("form-control js-datetime-date");
            Controls.Add(_date);

            _time    = new TextBox();
            _time.ID = "tbTime";
            _time.AddCssClass("form-control js-datetime-time");
            Controls.Add(_time);

            _cbCurrent    = new RockCheckBox();
            _cbCurrent.ID = "cbCurrent";
            _cbCurrent.AddCssClass("js-current-datetime-checkbox");
            _cbCurrent.Text = "Current Time";
            this.Controls.Add(_cbCurrent);

            _nbTimeOffset      = new RockTextBox();
            _nbTimeOffset.ID   = "nbTimeOffset";
            _nbTimeOffset.Help = "Enter the number of minutes after the current time to use as the date. Use a negative number to specify minutes before.";
            _nbTimeOffset.AddCssClass("input-width-md js-current-datetime-offset");
            _nbTimeOffset.Label = "+- Minutes";
            this.Controls.Add(_nbTimeOffset);

            RequiredFieldValidator.ControlToValidate = _date.ID;
        }
Example #7
0
        /// <summary>
        /// Called by the ASP.NET page framework to notify server controls that use composition-based implementation to create any child controls they contain in preparation for posting back or rendering.
        /// </summary>
        protected override void CreateChildControls()
        {
            base.CreateChildControls();
            Controls.Clear();
            RockControlHelper.CreateChildControls(this, Controls);

            _hfBinaryFileId.ID    = this.ID + "_hfBinaryFileId";
            _hfBinaryFileId.Value = "0";
            Controls.Add(_hfBinaryFileId);

            _hfBinaryFileTypeGuid.ID = this.ID + "_hfBinaryFileTypeGuid";
            Controls.Add(_hfBinaryFileTypeGuid);

            _aRemove           = new HtmlAnchor();
            _aRemove.ID        = "rmv";
            _aRemove.InnerHtml = "<i class='fa fa-times'></i>";
            Controls.Add(_aRemove);

            _fileUpload    = new FileUpload();
            _fileUpload.ID = this.ID + "_fu";
            Controls.Add(_fileUpload);

            RequiredFieldValidator.InitialValue      = "0";
            RequiredFieldValidator.ControlToValidate = _hfBinaryFileId.ID;
            RequiredFieldValidator.Display           = ValidatorDisplay.Dynamic;
        }
Example #8
0
        /// <summary>
        /// Called by the ASP.NET page framework to notify server controls that use composition-based implementation to create any child controls they contain in preparation for posting back or rendering.
        /// </summary>
        protected override void CreateChildControls()
        {
            base.CreateChildControls();

            Controls.Clear();
            RockControlHelper.CreateChildControls(this, Controls);

            _tbLowerValue          = new DatePicker();
            _tbLowerValue.ID       = this.ID + "_lower";
            _tbLowerValue.CssClass = "input-group-lower js-lower";
            Controls.Add(_tbLowerValue);

            _tbUpperValue          = new DatePicker();
            _tbUpperValue.ID       = this.ID + "_upper";
            _tbUpperValue.CssClass = "input-group-upper js-upper";
            Controls.Add(_tbUpperValue);

            // add custom validator
            CustomValidator.ID = this.ID + "_cfv";
            CustomValidator.ClientValidationFunction = "Rock.controls.dateRangePicker.clientValidate";
            CustomValidator.ErrorMessage             = (this.Label != string.Empty ? this.Label : string.Empty) + " is required.";
            CustomValidator.CssClass        = "validation-error help-inline";
            CustomValidator.Enabled         = true;
            CustomValidator.Display         = ValidatorDisplay.Dynamic;
            CustomValidator.ValidationGroup = ValidationGroup;
            Controls.Add(CustomValidator);
        }
Example #9
0
        /// <summary>
        /// Called by the ASP.NET page framework to notify server controls that use composition-based implementation to create any child controls they contain in preparation for posting back or rendering.
        /// </summary>
        protected override void CreateChildControls()
        {
            base.CreateChildControls();
            Controls.Clear();

            _ddlGroupType = new RockDropDownList();
            _ddlGroup     = new RockDropDownList();
            _ddlGroupRole = new RockDropDownList();

            RockControlHelper.CreateChildControls(this, Controls);

            _ddlGroupType.ID                    = this.ID + "_ddlGroupType";
            _ddlGroupType.AutoPostBack          = true;
            _ddlGroupType.SelectedIndexChanged += _ddlGroupType_SelectedIndexChanged;
            _ddlGroupType.Label                 = "Group Type";
            Controls.Add(_ddlGroupType);

            _ddlGroup.ID = this.ID + "_ddlGroup";
            Controls.Add(_ddlGroup);

            this.RequiredFieldValidator.ControlToValidate = _ddlGroup.ID;

            _ddlGroupRole.ID = this.ID + "_ddlGroupRole";
            Controls.Add(_ddlGroupRole);

            LoadGroupTypes();
        }
Example #10
0
        /// <summary>
        /// Called by the ASP.NET page framework to notify server controls that use composition-based implementation to create any child controls they contain in preparation for posting back or rendering.
        /// </summary>
        protected override void CreateChildControls()
        {
            base.CreateChildControls();
            Controls.Clear();

            RockControlHelper.CreateChildControls(this, Controls);

            this.SelectionMode = ListSelectionMode.Multiple;
        }
Example #11
0
        /// <summary>
        /// Called by the ASP.NET page framework to notify server controls that use composition-based implementation to create any child controls they contain in preparation for posting back or rendering.
        /// </summary>
        protected override void CreateChildControls()
        {
            base.CreateChildControls();
            Controls.Clear();
            RockControlHelper.CreateChildControls(this, Controls);

            _hfCountryCode    = new HiddenField();
            _hfCountryCode.ID = this.ID + "_hfCountryCode";
            Controls.Add(_hfCountryCode);
        }
Example #12
0
        /// <summary>
        /// Called by the ASP.NET page framework to notify server controls that use composition-based implementation to create any child controls they contain in preparation for posting back or rendering.
        /// </summary>
        protected override void CreateChildControls()
        {
            base.CreateChildControls();
            Controls.Clear();
            RockControlHelper.CreateChildControls(this, Controls);

            _bulletedList    = new BulletedList();
            _bulletedList.ID = this.ID;
            Controls.Add(_bulletedList);
        }
Example #13
0
        /// <summary>
        /// Called by the ASP.NET page framework to notify server controls that use composition-based implementation to create any child controls they contain in preparation for posting back or rendering.
        /// </summary>
        protected override void CreateChildControls()
        {
            base.CreateChildControls();
            Controls.Clear();
            RockControlHelper.CreateChildControls(this, Controls);

            _mfpMergeFields             = new MergeFieldPicker();
            _mfpMergeFields.ID          = string.Format("mfpMergeFields_{0}", this.ID);
            _mfpMergeFields.SelectItem += MergeFields_SelectItem;
            Controls.Add(_mfpMergeFields);
        }
Example #14
0
        /// <summary>
        /// Called by the ASP.NET page framework to notify server controls that use composition-based implementation to create any child controls they contain in preparation for posting back or rendering.
        /// </summary>
        protected override void CreateChildControls()
        {
            base.CreateChildControls();
            Controls.Clear();
            RockControlHelper.CreateChildControls(this, Controls);

            _hfDisableVrm       = new HiddenField();
            _hfDisableVrm.ID    = this.ID + "_dvrm";
            _hfDisableVrm.Value = "True";
            Controls.Add(_hfDisableVrm);
        }
Example #15
0
        /// <summary>
        /// Called by the ASP.NET page framework to notify server controls that use composition-based implementation to create any child controls they contain in preparation for posting back or rendering.
        /// </summary>
        protected override void CreateChildControls()
        {
            base.CreateChildControls();

            Controls.Clear();

            _hfTemplateKey          = new HiddenFieldWithClass();
            _hfTemplateKey.ID       = this.ID + "_hfValue";
            _hfTemplateKey.CssClass = "js-template-id";
            this.Controls.Add(_hfTemplateKey);

            _pnlStandard          = new Panel();
            _pnlStandard.ID       = this.ID + "_pnlOption";
            _pnlStandard.CssClass = "js-template-option-panel";
            this.Controls.Add(_pnlStandard);

            _btnCustomize                  = new LinkButton();
            _btnCustomize.CssClass         = "btn btn-xs btn-link";
            _btnCustomize.ID               = string.Format("{0}_btnCustomize", this.ID);
            _btnCustomize.Text             = "Customize";
            _btnCustomize.CausesValidation = false;
            _btnCustomize.Click           += btnCustomize_Click;
            this.Controls.Add(_btnCustomize);

            _pnlCustom          = new Panel();
            _pnlCustom.ID       = this.ID + "pnlCustom";
            _pnlCustom.CssClass = "js-template-custom-panel";
            this.Controls.Add(_pnlCustom);

            _rbbCustom         = new RockRadioButton();
            _rbbCustom.Checked = true;
            _rbbCustom.Text    = "<b>Custom</b>";
            _pnlCustom.Controls.Add(_rbbCustom);

            _actionDiv = new HtmlGenericControl("div");
            _pnlCustom.Controls.Add(_actionDiv);
            _actionDiv.Attributes["class"] = "actions clearfix";

            _btnStandard                  = new LinkButton();
            _btnStandard.CssClass         = "btn btn-xs btn-link pull-right";
            _btnStandard.ID               = string.Format("{0}_btnStandard", this.ID);
            _btnStandard.Text             = "Use Standard Templates";
            _btnStandard.CausesValidation = false;
            _btnStandard.Click           += btnStandard_Click;
            _actionDiv.Controls.Add(_btnStandard);

            _ceLavaTemplate          = new CodeEditor();
            _ceLavaTemplate.ID       = this.ID + "_ceLavaTemplate";
            _ceLavaTemplate.CssClass = "js-template-lava-field";
            _pnlCustom.Controls.Add(_ceLavaTemplate);

            RockControlHelper.CreateChildControls(this, Controls);
        }
Example #16
0
        /// <summary>
        /// Called by the ASP.NET page framework to notify server controls that use composition-based implementation to create any child controls they contain in preparation for posting back or rendering.
        /// </summary>
        protected override void CreateChildControls()
        {
            base.CreateChildControls();
            Controls.Clear();
            RockControlHelper.CreateChildControls(this, Controls);

            // TBD TODO -- do I need this hfGeoDisplayName_???
            _hfGeoDisplayName = new HiddenField();
            _hfGeoDisplayName.ClientIDMode = System.Web.UI.ClientIDMode.Static;
            _hfGeoDisplayName.ID           = string.Format("hfGeoDisplayName_{0}", this.ClientID);
            _hfGeoPath = new HiddenField();
            _hfGeoPath.ClientIDMode = System.Web.UI.ClientIDMode.Static;
            _hfGeoPath.ID           = string.Format("hfGeoPath_{0}", this.ClientID);

            if (ModePanel != null)
            {
                this.Controls.Add(ModePanel);
            }

            _btnSelect.ClientIDMode        = System.Web.UI.ClientIDMode.Static;
            _btnSelect.Attributes["class"] = "btn btn-xs btn-primary";
            _btnSelect.ID               = string.Format("btnSelect_{0}", this.ClientID);
            _btnSelect.InnerText        = "Done";
            _btnSelect.CausesValidation = false;

            // we only need the postback on Select if SelectItem is assigned
            if (SelectGeography != null)
            {
                _btnSelect.ServerClick += btnSelect_Click;
            }

            _btnSelectNone.ClientIDMode        = ClientIDMode.Static;
            _btnSelectNone.Attributes["class"] = "picker-select-none";
            _btnSelectNone.ID               = string.Format("btnSelectNone_{0}", this.ClientID);
            _btnSelectNone.InnerHtml        = "<i class='fa fa-times'></i>";
            _btnSelectNone.CausesValidation = false;
            _btnSelectNone.Style[HtmlTextWriterStyle.Display] = "none";

            // we only need the postback on SelectNone if SelectItem is assigned
            if (SelectGeography != null)
            {
                _btnSelectNone.ServerClick += btnSelect_Click;
            }

            Controls.Add(_hfGeoDisplayName);
            Controls.Add(_hfGeoPath);
            Controls.Add(_btnSelect);
            Controls.Add(_btnSelectNone);

            RequiredFieldValidator.InitialValue      = "0";
            RequiredFieldValidator.ControlToValidate = _hfGeoPath.ID;
        }
Example #17
0
        /// <summary>
        /// Called by the ASP.NET page framework to notify server controls that use composition-based implementation to create any child controls they contain in preparation for posting back or rendering.
        /// </summary>
        protected override void CreateChildControls()
        {
            base.CreateChildControls();
            Controls.Clear();

            _hfCheckListBoxId       = new HiddenField();
            _hfCheckListBoxId.ID    = "hf";
            _hfCheckListBoxId.Value = "1";

            Controls.Add(_hfCheckListBoxId);

            RockControlHelper.CreateChildControls(this, Controls);
        }
Example #18
0
        /// <summary>
        /// Called by the ASP.NET page framework to notify server controls that use composition-based implementation to create any child controls they contain in preparation for posting back or rendering.
        /// </summary>
        protected override void CreateChildControls()
        {
            base.CreateChildControls();
            Controls.Clear();
            RockControlHelper.CreateChildControls(this, Controls);

            _hfValue    = new HiddenField();
            _hfValue.ID = this.ID + "_hfValue";
            Controls.Add(_hfValue);

            this.RequiredFieldValidator.InitialValue      = "{}";
            this.RequiredFieldValidator.ControlToValidate = _hfValue.ID;
        }
        /// <summary>
        /// Called by the ASP.NET page framework to notify server controls that use composition-based implementation to create any child controls they contain in preparation for posting back or rendering.
        /// This method will also create the DefinedValueEditor
        /// </summary>
        protected override void CreateChildControls()
        {
            base.CreateChildControls();
            Controls.Clear();
            RockControlHelper.CreateChildControls(this, Controls);

            DefinedValueEditorControl               = new DefinedValueEditor();
            DefinedValueEditorControl.ID            = this.ID + "_definedValueEditor";
            DefinedValueEditorControl.Hidden        = true;
            DefinedValueEditorControl.DefinedTypeId = DefinedTypeId.Value;
            DefinedValueEditorControl.DefinedValueSelectorClientId = this.ClientID;
            Controls.Add(DefinedValueEditorControl);
        }
Example #20
0
        /// <summary>
        /// Called by the ASP.NET page framework to notify server controls that use composition-based implementation to create any child controls they contain in preparation for posting back or rendering.
        /// </summary>
        protected override void CreateChildControls()
        {
            base.CreateChildControls();

            Controls.Clear();
            RockControlHelper.CreateChildControls(this, Controls);

            hfSSN          = new HiddenFieldWithClass();
            hfSSN.ID       = string.Format("hfSSN_{0}", this.ID);
            hfSSN.CssClass = "js-ssn";

            this.RegularExpressionValidator.ID                   = ID + "_rev";
            this.RegularExpressionValidator.CssClass             = "validation-error help-inline";
            this.RegularExpressionValidator.ValidationExpression = @"\d{3}-\d{2}-\d{4}";
            this.RegularExpressionValidator.ControlToValidate    = hfSSN.ID;
            this.RegularExpressionValidator.ErrorMessage         = (this.Label != string.Empty ? this.Label : "SSN") + " is invalid.";
            this.RegularExpressionValidator.Enabled              = true;
            this.RegularExpressionValidator.Display              = ValidatorDisplay.Dynamic;
            this.RegularExpressionValidator.ValidationGroup      = ValidationGroup;
            Controls.Add(this.RegularExpressionValidator);

            this.RequiredFieldValidator.InitialValue      = string.Empty;
            this.RequiredFieldValidator.ControlToValidate = hfSSN.ID;

            ssnArea          = new TextBox();
            ssnArea.CssClass = "form-control ssn-part ssn-area";
            ssnArea.ID       = "ssnArea_" + this.ID;
            ssnArea.TextMode = TextBoxMode.Password;
            ssnArea.Attributes["pattern"] = "[0-9]*";
            ssnArea.MaxLength             = 3;

            ssnGroup          = new TextBox();
            ssnGroup.CssClass = "form-control ssn-part ssn-group";
            ssnGroup.ID       = "ssnGroup_" + this.ID;
            ssnGroup.TextMode = TextBoxMode.Password;
            ssnGroup.Attributes["pattern"] = "[0-9]*";
            ssnGroup.MaxLength             = 2;

            ssnSerial                      = new TextBox();
            ssnSerial.CssClass             = "form-control ssn-part ssn-serial";
            ssnSerial.ID                   = "ssnSerial_" + this.ID;
            ssnGroup.Attributes["pattern"] = "[0-9]*";
            ssnSerial.MaxLength            = 4;

            Controls.Add(hfSSN);
            Controls.Add(ssnArea);
            Controls.Add(ssnGroup);
            Controls.Add(ssnSerial);
        }
Example #21
0
        /// <summary>
        /// Called by the ASP.NET page framework to notify server controls that use composition-based implementation to create any child controls they contain in preparation for posting back or rendering.
        /// </summary>
        protected override void CreateChildControls()
        {
            base.CreateChildControls();
            Controls.Clear();
            RockControlHelper.CreateChildControls(this, Controls);

            GroupCustomValidator.ID = this.ID + "_cfv";
            GroupCustomValidator.ClientValidationFunction = "Rock.controls.numberUpDownGroup.clientValidate";
            GroupCustomValidator.ErrorMessage             = this.RequiredErrorMessage;
            GroupCustomValidator.CssClass        = "validation-error help-inline";
            GroupCustomValidator.Enabled         = true;
            GroupCustomValidator.Display         = ValidatorDisplay.Dynamic;
            GroupCustomValidator.ValidationGroup = ValidationGroup;
            Controls.Add(GroupCustomValidator);
        }
Example #22
0
        /// <summary>
        /// Called by the ASP.NET page framework to notify server controls that use composition-based implementation to create any child controls they contain in preparation for posting back or rendering.
        /// </summary>
        protected override void CreateChildControls()
        {
            base.CreateChildControls();
            Controls.Clear();

            RockControlHelper.CreateChildControls(this, Controls);

            this.Attributes.Add("type", "number");
            this.Attributes.Add("data-min", "1");
            this.Attributes.Add("data-max", "5");
            this.Attributes.Add("data-clearable", " ");
            this.Attributes.Add("data-icon-lib", "fa");
            this.Attributes.Add("data-active-icon", "fa-rating-selected");
            this.Attributes.Add("data-inactive-icon", "fa-rating-unselected");
            this.Attributes.Add("data-clearable-icon", "fa-remove");
        }
        /// <summary>
        /// Called by the ASP.NET page framework to notify server controls that use composition-based implementation to create any child controls they contain in preparation for posting back or rendering.
        /// </summary>
        protected override void CreateChildControls()
        {
            base.CreateChildControls();
            Controls.Clear();
            RockControlHelper.CreateChildControls(this, Controls);

            _registrationTemplatePicker             = new RegistrationTemplatePicker();
            _registrationTemplatePicker.ID          = this.ID + "_registrationTemplatePicker";
            _registrationTemplatePicker.SelectItem += _ddlRegistrationTemplate_SelectedIndexChanged;
            _registrationTemplatePicker.Label       = "Registration Template";
            Controls.Add(_registrationTemplatePicker);

            _ddlRegistrationInstance       = new RockDropDownList();
            _ddlRegistrationInstance.ID    = this.ID + "_ddlRegistrationInstance";
            _ddlRegistrationInstance.Label = "Registration Instance";
            Controls.Add(_ddlRegistrationInstance);
        }
Example #24
0
        /// <summary>
        /// Called by the ASP.NET page framework to notify server controls that use composition-based implementation to create any child controls they contain in preparation for posting back or rendering.
        /// </summary>
        protected override void CreateChildControls()
        {
            base.CreateChildControls();

            Controls.Clear();
            RockControlHelper.CreateChildControls(this, Controls);

            _tbLowerValue          = new DatePicker();
            _tbLowerValue.ID       = this.ID + "_lower";
            _tbLowerValue.CssClass = "input-width-md";
            Controls.Add(_tbLowerValue);

            _tbUpperValue          = new DatePicker();
            _tbUpperValue.ID       = this.ID + "_upper";
            _tbUpperValue.CssClass = "input-width-md";
            Controls.Add(_tbUpperValue);
        }
Example #25
0
        /// <summary>
        /// Called by the ASP.NET page framework to notify server controls that use composition-based implementation to create any child controls they contain in preparation for posting back or rendering.
        /// </summary>
        protected override void CreateChildControls()
        {
            base.CreateChildControls();

            Controls.Clear();
            RockControlHelper.CreateChildControls(this, Controls);

            _tbLowerValue          = new NumberBox();
            _tbLowerValue.ID       = this.ID + "_lower";
            _tbLowerValue.CssClass = "input-width-md js-number-range-lower";
            Controls.Add(_tbLowerValue);

            _tbUpperValue          = new NumberBox();
            _tbUpperValue.ID       = this.ID + "_upper";
            _tbUpperValue.CssClass = "input-width-md js-number-range-upper";
            Controls.Add(_tbUpperValue);
        }
Example #26
0
        /// <summary>
        /// Called by the ASP.NET page framework to notify server controls that use composition-based implementation to create any child controls they contain in preparation for posting back or rendering.
        /// </summary>
        protected override void CreateChildControls()
        {
            base.CreateChildControls();
            Controls.Clear();
            RockControlHelper.CreateChildControls(this, Controls);

            _hfValue    = new HiddenField();
            _hfValue.ID = this.ID + "_hfValue";
            Controls.Add(_hfValue);

            _hfValueDisableVrm    = new HiddenField();
            _hfValueDisableVrm.ID = _hfValue.ID + "_dvrm";
            Controls.Add(_hfValueDisableVrm);

            // Link the RequiredFieldValidator to the hidden field that stores the value list.
            this.RequiredFieldValidator.ControlToValidate = _hfValue.ID;
        }
Example #27
0
        /// <summary>
        /// Called by the ASP.NET page framework to notify server controls that use composition-based implementation to create any child controls they contain in preparation for posting back or rendering.
        /// </summary>
        protected override void CreateChildControls()
        {
            base.CreateChildControls();

            Controls.Clear();

            _hfPersonId          = new HiddenFieldWithClass();
            _hfPersonId.CssClass = "js-person-id";
            Controls.Add(_hfPersonId);
            _hfPersonId.ID    = "hfPersonId";
            _hfPersonId.Value = "0";

            _hfPersonName          = new HiddenFieldWithClass();
            _hfPersonName.CssClass = "js-person-name";
            Controls.Add(_hfPersonName);
            _hfPersonName.ID = "hfPersonName";

            _hfIncludeBusinesses          = new HiddenFieldWithClass();
            _hfIncludeBusinesses.CssClass = "js-include-businesses";
            Controls.Add(_hfIncludeBusinesses);
            _hfIncludeBusinesses.ID = "hfIncludeBusinesses";

            _btnSelect = new HtmlAnchor();
            Controls.Add(_btnSelect);
            _btnSelect.Attributes["class"] = "btn btn-xs btn-primary";
            _btnSelect.ID               = "btnSelect";
            _btnSelect.InnerText        = "Select";
            _btnSelect.CausesValidation = false;
            _btnSelect.ServerClick     += btnSelect_Click;

            _btnSelectNone = new HtmlAnchor();
            Controls.Add(_btnSelectNone);
            _btnSelectNone.Attributes["class"] = "picker-select-none";
            _btnSelectNone.ID               = "btnSelectNone";
            _btnSelectNone.InnerHtml        = "<i class='fa fa-times'></i>";
            _btnSelectNone.CausesValidation = false;
            _btnSelectNone.Style[HtmlTextWriterStyle.Display] = "none";
            _btnSelectNone.ServerClick += btnSelect_Click;

            RockControlHelper.CreateChildControls(this, Controls);

            // override a couple of property values on RequiredFieldValidator so that Validation works correctly
            RequiredFieldValidator.InitialValue      = "0";
            RequiredFieldValidator.ControlToValidate = _hfPersonId.ID;
        }
Example #28
0
        /// <summary>
        /// Called by the ASP.NET page framework to notify server controls that use composition-based implementation to create any child controls they contain in preparation for posting back or rendering.
        /// </summary>
        protected override void CreateChildControls()
        {
            base.CreateChildControls();

            Controls.Clear();
            RockControlHelper.CreateChildControls(this, Controls);

            _datePicker          = new DatePicker();
            _datePicker.ID       = this.ID + "_datePicker";
            _datePicker.CssClass = "input-width-md";

            Controls.Add(_datePicker);

            _timePicker          = new TimePicker();
            _timePicker.ID       = this.ID + "_timePicker";
            _timePicker.CssClass = "input-width-md";
            Controls.Add(_timePicker);
        }
Example #29
0
        /// <summary>
        /// Called by the ASP.NET page framework to notify server controls that use composition-based implementation to create any child controls they contain in preparation for posting back or rendering.
        /// </summary>
        protected override void CreateChildControls()
        {
            base.CreateChildControls();
            Controls.Clear();
            RockControlHelper.CreateChildControls(this, Controls);

            _ddlGroupType                       = new RockDropDownList();
            _ddlGroupType.ID                    = this.ID + "_ddlGroupType";
            _ddlGroupType.AutoPostBack          = true;
            _ddlGroupType.SelectedIndexChanged += _ddlGroupType_SelectedIndexChanged;
            Controls.Add(_ddlGroupType);

            _ddlGroupRole    = new RockDropDownList();
            _ddlGroupRole.ID = this.ID + "_ddlGroupRole";
            Controls.Add(_ddlGroupRole);

            LoadGroupTypes();
        }
Example #30
0
        /// <summary>
        /// Called by the ASP.NET page framework to notify server controls that use composition-based implementation to create any child controls they contain in preparation for posting back or rendering.
        /// </summary>
        protected override void CreateChildControls()
        {
            base.CreateChildControls();
            Controls.Clear();
            RockControlHelper.CreateChildControls(this, Controls);

            _hfDisableVrm       = new HiddenField();
            _hfDisableVrm.ID    = this.ID + "_dvrm";
            _hfDisableVrm.Value = "True";
            Controls.Add(_hfDisableVrm);

            _regexValidator    = new RegularExpressionValidator();
            _regexValidator.ID = this.ID + "_LengthRE";
            _regexValidator.ControlToValidate = this.ID;
            _regexValidator.Display           = ValidatorDisplay.Dynamic;
            _regexValidator.CssClass          = "validation-error help-inline";
            _regexValidator.Enabled           = false;
            Controls.Add(_regexValidator);
        }