public RenderControl ( System.Web.UI.HtmlTextWriter writer ) : void | ||
writer | System.Web.UI.HtmlTextWriter | The |
리턴 | void |
/// <summary> /// Outputs server control content to a provided <see cref="T:System.Web.UI.HtmlTextWriter" /> object and stores tracing information about the control if tracing is enabled. /// </summary> /// <param name="writer">The <see cref="T:System.Web.UI.HtmlTextWriter" /> object that receives the control content.</param> public override void RenderControl(HtmlTextWriter writer) { if (this.Visible) { writer.AddAttribute(HtmlTextWriterAttribute.Class, "pull-right"); writer.RenderBeginTag(HtmlTextWriterTag.Div); _lbDelete.RenderControl(writer); writer.RenderEndTag(); writer.RenderBeginTag(HtmlTextWriterTag.H4); writer.Write(Caption); writer.RenderEndTag(); // Relationship writer.AddAttribute(HtmlTextWriterAttribute.Class, "row"); writer.RenderBeginTag(HtmlTextWriterTag.Div); writer.AddAttribute(HtmlTextWriterAttribute.Class, "col-sm-6"); writer.RenderBeginTag(HtmlTextWriterTag.Div); _ddlRelationshipType.RenderControl(writer); writer.RenderEndTag(); writer.AddAttribute(HtmlTextWriterAttribute.Class, "col-sm-6"); // filler/blocker column writer.RenderBeginTag(HtmlTextWriterTag.Div); writer.RenderEndTag(); writer.RenderEndTag(); // end Relationship row writer.AddAttribute("rowid", ID); writer.AddAttribute(HtmlTextWriterAttribute.Class, "row clearfix"); writer.RenderBeginTag(HtmlTextWriterTag.Div); bool existingPerson = (this.PersonId > 0); _lNickName.Visible = existingPerson; _lLastName.Visible = existingPerson; _tbNickName.Visible = !existingPerson; _tbLastName.Visible = !existingPerson; writer.AddAttribute(HtmlTextWriterAttribute.Class, "col-sm-3"); writer.RenderBeginTag(HtmlTextWriterTag.Div); _lNickName.RenderControl(writer); _tbNickName.RenderControl(writer); writer.RenderEndTag(); writer.AddAttribute(HtmlTextWriterAttribute.Class, "col-sm-3"); writer.RenderBeginTag(HtmlTextWriterTag.Div); _lLastName.RenderControl(writer); _tbLastName.RenderControl(writer); writer.RenderEndTag(); if (this.ShowSuffix) { writer.AddAttribute(HtmlTextWriterAttribute.Class, "col-sm-3"); writer.RenderBeginTag(HtmlTextWriterTag.Div); _ddlSuffix.RenderControl(writer); writer.RenderEndTag(); } if (this.ShowGender) { writer.AddAttribute(HtmlTextWriterAttribute.Class, "col-sm-3"); writer.RenderBeginTag(HtmlTextWriterTag.Div); _ddlGender.RenderControl(writer); writer.RenderEndTag(); } if (this.ShowBirthDate) { writer.AddAttribute(HtmlTextWriterAttribute.Class, "col-sm-3"); writer.RenderBeginTag(HtmlTextWriterTag.Div); _dpBirthdate.RenderControl(writer); writer.RenderEndTag(); } if (this.ShowGrade) { writer.AddAttribute(HtmlTextWriterAttribute.Class, "col-sm-3"); writer.RenderBeginTag(HtmlTextWriterTag.Div); _ddlGradePicker.RenderControl(writer); writer.RenderEndTag(); } if (this.ShowMobilePhone) { writer.AddAttribute(HtmlTextWriterAttribute.Class, "col-sm-3"); writer.RenderBeginTag(HtmlTextWriterTag.Div); _pnbMobile.RenderControl(writer); writer.RenderEndTag(); } foreach (Control attributeCtrl in _phAttributes.Controls) { writer.AddAttribute(HtmlTextWriterAttribute.Class, "col-sm-3"); writer.RenderBeginTag(HtmlTextWriterTag.Div); attributeCtrl.RenderControl(writer); writer.RenderEndTag(); } writer.RenderEndTag(); writer.RenderBeginTag(HtmlTextWriterTag.Hr); writer.RenderEndTag(); } }
/// <summary> /// Renders the base control. /// </summary> /// <param name="writer">The writer.</param> public void RenderBaseControl(HtmlTextWriter writer) { if (this.Visible) { bool showAddressLine2 = ShowAddressLine2; string cityLabel = "City"; string stateLabel = "Region"; string postalCodeLabel = "Postal Code"; var countryValue = DefinedTypeCache.Get(new Guid(SystemGuid.DefinedType.LOCATION_COUNTRIES)) .DefinedValues .Where(v => v.Value.Equals(_ddlCountry.SelectedValue, StringComparison.OrdinalIgnoreCase)) .FirstOrDefault(); if (countryValue != null) { cityLabel = countryValue.GetAttributeValue("CityLabel"); stateLabel = countryValue.GetAttributeValue("StateLabel"); postalCodeLabel = countryValue.GetAttributeValue("PostalCodeLabel"); // only show Address Line 2 if this Control's ShowAddressLine2 and the Country's ShowAddressLine2 are both true if (showAddressLine2) { showAddressLine2 = countryValue.GetAttributeValue("ShowAddressLine2").AsBoolean(); } } // if this address has a value for Street2, show it regardless of the ShowAddressLine2 showAddressLine2 = showAddressLine2 || !string.IsNullOrWhiteSpace(_tbStreet2.Text); if (_ddlCountry.Visible) { writer.AddAttribute("class", "form-row"); writer.RenderBeginTag(HtmlTextWriterTag.Div); writer.AddAttribute("class", "form-group col-sm-6"); writer.RenderBeginTag(HtmlTextWriterTag.Div); _ddlCountry.RenderControl(writer); writer.RenderEndTag(); // div.form-group writer.AddAttribute("class", "form-group col-sm-6"); writer.RenderBeginTag(HtmlTextWriterTag.Div); writer.RenderEndTag(); // div.form-group writer.RenderEndTag(); // div.row } writer.AddAttribute("class", "js-addressControl"); writer.AddAttribute("data-required", this.Required.ToTrueFalse().ToLower()); writer.AddAttribute("data-itemlabel", this.Label != string.Empty ? this.Label : "Address"); writer.AddAttribute("id", this.ClientID); writer.RenderBeginTag(HtmlTextWriterTag.Div); writer.AddAttribute("class", "form-group " + (this.Required ? "required" : string.Empty)); writer.RenderBeginTag(HtmlTextWriterTag.Div); _tbStreet1.Attributes["placeholder"] = showAddressLine2 ? "Address Line 1" : "Address"; _tbStreet1.Attributes["autocomplete"] = showAddressLine2 ? "address-line1" : "street-address"; _tbStreet1.RenderControl(writer); writer.RenderEndTag(); // div.form-group if (showAddressLine2) { writer.AddAttribute("class", "form-group"); writer.RenderBeginTag(HtmlTextWriterTag.Div); _tbStreet2.Attributes["placeholder"] = "Address Line 2"; _tbStreet2.Attributes["autocomplete"] = "address-line2"; _tbStreet2.RenderControl(writer); writer.RenderEndTag(); // div.form-group } writer.AddAttribute("class", "form-row"); writer.RenderBeginTag(HtmlTextWriterTag.Div); writer.AddAttribute("class", (ShowCounty ? "form-group col-sm-3 " : "form-group col-sm-6 " + (this.Required ? "required" : string.Empty))); writer.RenderBeginTag(HtmlTextWriterTag.Div); _tbCity.Attributes["placeholder"] = cityLabel; _tbCity.Attributes["autocomplete"] = "address-level2"; _tbCity.RenderControl(writer); writer.RenderEndTag(); // div.form-group if (ShowCounty) { writer.AddAttribute("class", "form-group col-sm-3"); writer.RenderBeginTag(HtmlTextWriterTag.Div); _tbCounty.Attributes["placeholder"] = "County"; _tbCounty.Attributes["autocomplete"] = "country"; _tbCounty.RenderControl(writer); writer.RenderEndTag(); // div.form-group } writer.AddAttribute("class", "form-group col-sm-3 " + (this.Required ? "required" : string.Empty)); writer.RenderBeginTag(HtmlTextWriterTag.Div); _tbState.Attributes["placeholder"] = stateLabel; _tbState.Attributes["autocomplete"] = "address-level1"; _tbState.RenderControl(writer); _ddlState.RenderControl(writer); writer.RenderEndTag(); // div.form-group writer.AddAttribute("class", "form-group col-sm-3"); writer.RenderBeginTag(HtmlTextWriterTag.Div); _tbPostalCode.Attributes["placeholder"] = postalCodeLabel; _tbPostalCode.Attributes["autocomplete"] = "postal-code"; _tbPostalCode.RenderControl(writer); writer.RenderEndTag(); // div.form-group writer.RenderEndTag(); // div.form-row CustomValidator.RenderControl(writer); writer.RenderEndTag(); // div } }
/// <summary> /// This is where you implement the simple aspects of rendering your control. The rest /// will be handled by calling RenderControlHelper's RenderControl() method. /// </summary> /// <param name="writer">The writer.</param> public void RenderBaseControl(HtmlTextWriter writer) { if (Rows > 1) { _textBox.TextMode = TextBoxMode.MultiLine; _textBox.Rows = Rows; } else { _textBox.TextMode = TextBoxMode.SingleLine; } bool ddlItemSelected = false; foreach (ListItem li in _dropDownList.Items) { if (li.Value == _hiddenField.Value) { li.Selected = true; ddlItemSelected = true; } else { li.Selected = false; } } if (!ddlItemSelected) { _textBox.Text = _hiddenField.Value; } writer.AddAttribute(HtmlTextWriterAttribute.Class, "row js-text-or-ddl-row " + this.CssClass); writer.AddAttribute(HtmlTextWriterAttribute.Style, this.Style.Value); writer.RenderBeginTag(HtmlTextWriterTag.Div); _hiddenField.RenderControl(writer); if (ValidateRequestMode == System.Web.UI.ValidateRequestMode.Disabled) { _hfDisableVrm.RenderControl(writer); } writer.AddAttribute(HtmlTextWriterAttribute.Class, "col-xs-6"); writer.RenderBeginTag(HtmlTextWriterTag.Div); _textBox.AddCssClass("js-text-or-ddl-input"); _textBox.RenderControl(writer); writer.RenderEndTag(); writer.AddAttribute(HtmlTextWriterAttribute.Class, "col-xs-1"); writer.RenderBeginTag(HtmlTextWriterTag.Div); var lOr = new RockLiteral(); lOr.Label = " "; lOr.Text = "or"; lOr.RenderControl(writer); writer.RenderEndTag(); writer.AddAttribute(HtmlTextWriterAttribute.Class, "col-xs-5"); writer.RenderBeginTag(HtmlTextWriterTag.Div); _dropDownList.AddCssClass("js-text-or-ddl-input"); _dropDownList.RenderControl(writer); writer.RenderEndTag(); writer.RenderEndTag(); // row RegisterClientScript(); }
/// <summary> /// Writes the <see cref="T:System.Web.UI.WebControls.CompositeControl" /> content to the specified <see cref="T:System.Web.UI.HtmlTextWriter" /> object, for display on the client. /// </summary> /// <param name="writer">An <see cref="T:System.Web.UI.HtmlTextWriter" /> that represents the output stream to render HTML content on the client.</param> public override void RenderControl(HtmlTextWriter writer) { DataFilterComponent component = null; string clientFormatString = string.Empty; if (!string.IsNullOrWhiteSpace(FilterEntityTypeName)) { component = Rock.Reporting.DataFilterContainer.GetComponent(FilterEntityTypeName); if (component != null) { clientFormatString = string.Format("if ($(this).find('.filter-view-state').children('i').hasClass('fa-chevron-up')) {{ var $article = $(this).parents('article:first'); var $content = $article.children('div.panel-body'); $article.find('div.filter-item-description:first').html({0}); }}", component.GetClientFormatSelection(FilteredEntityType)); } } if (component == null) { hfExpanded.Value = "True"; } bool showFilterTypePicker = this.FilterMode == FilterMode.AdvancedFilter; if (showFilterTypePicker) { // only render this stuff if the filter type picker is shown writer.AddAttribute(HtmlTextWriterAttribute.Class, "panel panel-widget filter-item"); writer.RenderBeginTag("article"); writer.AddAttribute(HtmlTextWriterAttribute.Class, "panel-heading clearfix"); if (!string.IsNullOrEmpty(clientFormatString)) { writer.AddAttribute(HtmlTextWriterAttribute.Onclick, clientFormatString); } writer.RenderBeginTag("header"); writer.AddAttribute(HtmlTextWriterAttribute.Class, "filter-expanded"); hfExpanded.RenderControl(writer); writer.AddAttribute(HtmlTextWriterAttribute.Class, "pull-left"); writer.RenderBeginTag(HtmlTextWriterTag.Div); writer.AddAttribute(HtmlTextWriterAttribute.Class, "filter-item-description"); if (Expanded) { writer.AddStyleAttribute(HtmlTextWriterStyle.Display, "none"); } writer.RenderBeginTag(HtmlTextWriterTag.Div); writer.Write(component != null ? component.FormatSelection(FilteredEntityType, this.GetSelection()) : "Select Filter"); writer.RenderEndTag(); writer.AddAttribute(HtmlTextWriterAttribute.Class, "filter-item-select"); if (!Expanded) { writer.AddStyleAttribute(HtmlTextWriterStyle.Display, "none"); } writer.RenderBeginTag(HtmlTextWriterTag.Div); writer.RenderBeginTag(HtmlTextWriterTag.Span); writer.Write("Filter Type "); writer.RenderEndTag(); ddlFilterType.RenderControl(writer); writer.RenderEndTag(); writer.RenderEndTag(); writer.AddAttribute(HtmlTextWriterAttribute.Class, "pull-right"); writer.RenderBeginTag(HtmlTextWriterTag.Div); writer.AddAttribute(HtmlTextWriterAttribute.Class, "btn btn-link btn-xs filter-view-state"); writer.RenderBeginTag(HtmlTextWriterTag.A); writer.AddAttribute(HtmlTextWriterAttribute.Class, Expanded ? "fa fa-chevron-up" : "fa fa-chevron-down"); writer.RenderBeginTag(HtmlTextWriterTag.I); writer.RenderEndTag(); writer.RenderEndTag(); writer.Write(" "); lbDelete.Visible = (this.DeleteClick != null); lbDelete.RenderControl(writer); writer.RenderEndTag(); writer.RenderEndTag(); writer.AddAttribute("class", "panel-body"); if (!Expanded) { writer.AddStyleAttribute(HtmlTextWriterStyle.Display, "none"); } writer.RenderBeginTag(HtmlTextWriterTag.Div); } writer.AddAttribute("class", "row js-filter-row filterfield"); writer.RenderBeginTag(HtmlTextWriterTag.Div); writer.AddAttribute("class", "col-md-12"); writer.RenderBeginTag(HtmlTextWriterTag.Div); if (ShowCheckbox) { //// EntityFieldFilter renders the checkbox itself (see EntityFieldFilter.cs), //// so only render the checkbox if we are hiding filter criteria and it isn't an entity field filter if (!(component is Rock.Reporting.DataFilter.EntityFieldFilter) || HideFilterCriteria) { cbIncludeFilter.Text = this.Label; cbIncludeFilter.RenderControl(writer); } } else if (!string.IsNullOrWhiteSpace(this.Label)) { writer.AddAttribute(HtmlTextWriterAttribute.Class, "control-label"); writer.AddAttribute(HtmlTextWriterAttribute.For, this.ClientID); writer.RenderBeginTag(HtmlTextWriterTag.Label); writer.Write(Label); writer.RenderEndTag(); // label } if (component != null && !HideFilterCriteria) { component.RenderControls(FilteredEntityType, this, writer, filterControls, this.FilterMode); } writer.RenderEndTag(); // "col-md-12" writer.RenderEndTag(); // "row js-filter-row filter-row" if (showFilterTypePicker) { writer.RenderEndTag(); writer.RenderEndTag(); } }
/// <summary> /// Writes the <see cref="T:System.Web.UI.WebControls.CompositeControl" /> content to the specified <see cref="T:System.Web.UI.HtmlTextWriter" /> object, for display on the client. /// </summary> /// <param name="writer">An <see cref="T:System.Web.UI.HtmlTextWriter" /> that represents the output stream to render HTML content on the client.</param> public override void RenderControl(HtmlTextWriter writer) { DataFilterComponent component = null; string clientFormatString = string.Empty; if (!string.IsNullOrWhiteSpace(FilterEntityTypeName)) { component = Rock.Reporting.DataFilterContainer.GetComponent(FilterEntityTypeName); if (component != null) { clientFormatString = string.Format("if ($(this).find('.filter-view-state').children('i').attr('class') == 'fa-chevron-up') {{ var $article = $(this).parents('article:first'); var $content = $article.children('div.panel-body'); $article.find('div.filter-item-description:first').html({0}); }}", component.GetClientFormatSelection(FilteredEntityType)); } } if (component == null) { hfExpanded.Value = "True"; } writer.AddAttribute(HtmlTextWriterAttribute.Class, "panel panel-widget filter-item"); writer.RenderBeginTag("article"); writer.AddAttribute(HtmlTextWriterAttribute.Class, "panel-heading clearfix"); if (!string.IsNullOrEmpty(clientFormatString)) { writer.AddAttribute(HtmlTextWriterAttribute.Onclick, clientFormatString); } writer.RenderBeginTag("header"); writer.AddAttribute(HtmlTextWriterAttribute.Class, "filter-expanded"); hfExpanded.RenderControl(writer); writer.AddAttribute(HtmlTextWriterAttribute.Class, "pull-left"); writer.RenderBeginTag(HtmlTextWriterTag.Div); writer.AddAttribute(HtmlTextWriterAttribute.Class, "filter-item-description"); if (Expanded) { writer.AddStyleAttribute(HtmlTextWriterStyle.Display, "none"); } writer.RenderBeginTag(HtmlTextWriterTag.Div); writer.Write(component != null ? component.FormatSelection(FilteredEntityType, Selection) : "Select Filter"); writer.RenderEndTag(); writer.AddAttribute(HtmlTextWriterAttribute.Class, "filter-item-select"); if (!Expanded) { writer.AddStyleAttribute(HtmlTextWriterStyle.Display, "none"); } writer.RenderBeginTag(HtmlTextWriterTag.Div); writer.RenderBeginTag(HtmlTextWriterTag.Span); writer.Write("Filter Type "); writer.RenderEndTag(); ddlFilterType.RenderControl(writer); writer.RenderEndTag(); writer.RenderEndTag(); writer.AddAttribute(HtmlTextWriterAttribute.Class, "pull-right"); writer.RenderBeginTag(HtmlTextWriterTag.Div); writer.AddAttribute(HtmlTextWriterAttribute.Class, "btn btn-xs filter-view-state"); writer.RenderBeginTag(HtmlTextWriterTag.A); writer.AddAttribute(HtmlTextWriterAttribute.Class, Expanded ? "fa fa-chevron-up" : "fa fa-chevron-down"); writer.RenderBeginTag(HtmlTextWriterTag.I); writer.RenderEndTag(); writer.RenderEndTag(); writer.Write(" "); lbDelete.RenderControl(writer); writer.RenderEndTag(); writer.RenderEndTag(); writer.AddAttribute("class", "panel-body"); if (!Expanded) { writer.AddStyleAttribute(HtmlTextWriterStyle.Display, "none"); } writer.RenderBeginTag(HtmlTextWriterTag.Div); if (component != null) { component.RenderControls(FilteredEntityType, this, writer, filterControls); } writer.RenderEndTag(); writer.RenderEndTag(); }
/// <summary> /// Outputs server control content to a provided <see cref="T:System.Web.UI.HtmlTextWriter" /> object and stores tracing information about the control if tracing is enabled. /// </summary> /// <param name="writer">The <see cref="T:System.Web.UI.HtmlTextWriter" /> object that receives the control content.</param> public override void RenderControl(HtmlTextWriter writer) { if (_hfFormGuid.Value.AsGuid() != Guid.Empty) { _hfFormGuid.RenderControl(writer); writer.AddAttribute(HtmlTextWriterAttribute.Class, "row"); writer.RenderBeginTag(HtmlTextWriterTag.Div); writer.AddAttribute(HtmlTextWriterAttribute.Class, "col-md-6"); writer.RenderBeginTag(HtmlTextWriterTag.Div); _ddlNotificationSystemEmail.RenderControl(writer); writer.RenderEndTag(); writer.AddAttribute(HtmlTextWriterAttribute.Class, "col-md-6"); writer.RenderBeginTag(HtmlTextWriterTag.Div); _cbIncludeActions.RenderControl(writer); writer.RenderEndTag(); writer.RenderEndTag(); // row _cbAllowNotes.RenderControl(writer); _ceHeaderText.ValidationGroup = ValidationGroup; _ceHeaderText.RenderControl(writer); // Attributes if (AttributeRows.Any()) { writer.AddAttribute(HtmlTextWriterAttribute.Class, "form-group"); writer.RenderBeginTag(HtmlTextWriterTag.Div); writer.AddAttribute(HtmlTextWriterAttribute.Class, "control-label"); writer.RenderBeginTag(HtmlTextWriterTag.Label); writer.Write("Form Fields"); writer.AddAttribute("class", "help"); writer.AddAttribute("href", "#"); writer.RenderBeginTag(HtmlTextWriterTag.A); writer.AddAttribute("class", "fa fa-question-circle"); writer.RenderBeginTag(HtmlTextWriterTag.I); writer.RenderEndTag(); writer.RenderEndTag(); writer.AddAttribute("class", "alert alert-info"); writer.AddAttribute("style", "display:none"); writer.RenderBeginTag(HtmlTextWriterTag.Div); writer.RenderBeginTag(HtmlTextWriterTag.Small); writer.Write("The fields (attributes) to display on the entry form"); writer.RenderEndTag(); writer.RenderEndTag(); writer.RenderEndTag(); // Label writer.AddAttribute(HtmlTextWriterAttribute.Class, "grid-table table table-condensed table-light"); writer.RenderBeginTag(HtmlTextWriterTag.Table); writer.RenderBeginTag(HtmlTextWriterTag.Thead); writer.RenderBeginTag(HtmlTextWriterTag.Tr); writer.AddAttribute(HtmlTextWriterAttribute.Class, "grid-columncommand"); writer.RenderBeginTag(HtmlTextWriterTag.Th); writer.Write(" "); writer.RenderEndTag(); writer.AddAttribute(HtmlTextWriterAttribute.Scope, "col"); writer.RenderBeginTag(HtmlTextWriterTag.Th); writer.AddAttribute(HtmlTextWriterAttribute.Class, "row"); writer.RenderBeginTag(HtmlTextWriterTag.Div); writer.AddAttribute(HtmlTextWriterAttribute.Class, "col-xs-3"); writer.RenderBeginTag(HtmlTextWriterTag.Div); writer.Write("Field"); writer.RenderEndTag(); writer.AddAttribute(HtmlTextWriterAttribute.Class, "col-xs-9"); writer.RenderBeginTag(HtmlTextWriterTag.Div); writer.AddAttribute(HtmlTextWriterAttribute.Class, "row"); writer.RenderBeginTag(HtmlTextWriterTag.Div); writer.AddAttribute(HtmlTextWriterAttribute.Class, "col-xs-2"); writer.RenderBeginTag(HtmlTextWriterTag.Div); writer.Write("Visible"); writer.RenderEndTag(); writer.AddAttribute(HtmlTextWriterAttribute.Class, "col-xs-2"); writer.RenderBeginTag(HtmlTextWriterTag.Div); writer.Write("Editable"); writer.RenderEndTag(); writer.AddAttribute(HtmlTextWriterAttribute.Class, "col-xs-2"); writer.RenderBeginTag(HtmlTextWriterTag.Div); writer.Write("Required"); writer.RenderEndTag(); writer.AddAttribute(HtmlTextWriterAttribute.Class, "col-xs-2"); writer.RenderBeginTag(HtmlTextWriterTag.Div); writer.Write("Hide Label"); writer.RenderEndTag(); writer.AddAttribute(HtmlTextWriterAttribute.Class, "col-xs-2"); writer.RenderBeginTag(HtmlTextWriterTag.Div); writer.Write("Pre-HTML"); writer.RenderEndTag(); writer.AddAttribute(HtmlTextWriterAttribute.Class, "col-xs-2"); writer.RenderBeginTag(HtmlTextWriterTag.Div); writer.Write("Post-HTML"); writer.RenderEndTag(); writer.RenderEndTag(); // row writer.RenderEndTag(); // col-xs-9 writer.RenderEndTag(); // row writer.RenderEndTag(); // th writer.RenderEndTag(); // tr writer.RenderEndTag(); // thead writer.AddAttribute(HtmlTextWriterAttribute.Class, "workflow-formfield-list"); writer.RenderBeginTag(HtmlTextWriterTag.Tbody); foreach (var row in AttributeRows) { row.RenderControl(writer); } writer.RenderEndTag(); // tbody writer.RenderEndTag(); // table writer.RenderEndTag(); // Div.form-group } _ceFooterText.ValidationGroup = ValidationGroup; _ceFooterText.RenderControl(writer); _falActions.RenderControl(writer); writer.AddAttribute(HtmlTextWriterAttribute.Class, "row"); writer.RenderBeginTag(HtmlTextWriterTag.Div); writer.AddAttribute(HtmlTextWriterAttribute.Class, "col-md-6"); writer.RenderBeginTag(HtmlTextWriterTag.Div); _ddlActionAttribute.RenderControl(writer); writer.RenderEndTag(); writer.AddAttribute(HtmlTextWriterAttribute.Class, "col-md-6"); writer.RenderBeginTag(HtmlTextWriterTag.Div); writer.RenderEndTag(); writer.RenderEndTag(); // row } }
/// <summary> /// Writes the <see cref="T:System.Web.UI.WebControls.CompositeControl" /> content to the specified <see cref="T:System.Web.UI.HtmlTextWriter" /> object, for display on the client. /// </summary> /// <param name="writer">An <see cref="T:System.Web.UI.HtmlTextWriter" /> that represents the output stream to render HTML content on the client.</param> public override void RenderControl(HtmlTextWriter writer) { string inactiveCss = _cbActivityIsComplete.Checked ? string.Empty : " workflow-activity-inactive"; writer.AddAttribute(HtmlTextWriterAttribute.Class, "panel panel-widget workflow-activity" + inactiveCss); writer.AddAttribute("data-key", _hfActivityGuid.Value); writer.AddAttribute(HtmlTextWriterAttribute.Id, this.ID + "_section"); writer.RenderBeginTag("section"); writer.AddAttribute(HtmlTextWriterAttribute.Class, "panel-heading clearfix clickable"); writer.RenderBeginTag("header"); // Hidden Field to track expansion writer.AddAttribute(HtmlTextWriterAttribute.Class, "filter-expanded"); _hfExpanded.RenderControl(writer); writer.AddAttribute(HtmlTextWriterAttribute.Class, "filter-toggle pull-left"); writer.RenderBeginTag(HtmlTextWriterTag.Div); writer.AddAttribute("class", "panel-title"); writer.RenderBeginTag(HtmlTextWriterTag.H3); _lblActivityTypeName.RenderControl(writer); // H3 tag writer.RenderEndTag(); _lblActivityTypeDescription.RenderControl(writer); // Name/Description div writer.RenderEndTag(); writer.AddAttribute(HtmlTextWriterAttribute.Class, "pull-right activity-controls"); writer.RenderBeginTag(HtmlTextWriterTag.Div); writer.WriteLine(string.Format("<a class='btn btn-xs btn-link'><i class='workflow-activity-state fa {0}'></i></a>", Expanded ? "fa fa-chevron-up" : "fa fa-chevron-down")); if (CanEdit && IsDeleteEnabled) { _lbDeleteActivityType.Visible = true; _lbDeleteActivityType.RenderControl(writer); } else { _lbDeleteActivityType.Visible = false; } // Add/ChevronUpDown/Delete div writer.RenderEndTag(); _lblStatus.RenderControl(writer); // header div writer.RenderEndTag(); if (!Expanded) { // hide details if the activity and actions are valid writer.AddStyleAttribute("display", "none"); } writer.AddAttribute(HtmlTextWriterAttribute.Class, "panel-body"); writer.RenderBeginTag(HtmlTextWriterTag.Div); // activity edit fields writer.AddAttribute(HtmlTextWriterAttribute.Class, "row"); writer.RenderBeginTag(HtmlTextWriterTag.Div); writer.AddAttribute(HtmlTextWriterAttribute.Class, "col-md-6"); writer.RenderBeginTag(HtmlTextWriterTag.Div); if (CanEdit) { _ppAssignedToPerson.ValidationGroup = ValidationGroup; _ppAssignedToPerson.RenderControl(writer); _gpAssignedToGroup.ValidationGroup = ValidationGroup; _gpAssignedToGroup.RenderControl(writer); _ddlAssignedToRole.ValidationGroup = ValidationGroup; _ddlAssignedToRole.RenderControl(writer); } else { if (!string.IsNullOrWhiteSpace(_lAssignedToPerson.Text)) { _lAssignedToPerson.RenderControl(writer); } if (!string.IsNullOrWhiteSpace(_lAssignedToGroup.Text)) { _lAssignedToGroup.RenderControl(writer); } if (!string.IsNullOrWhiteSpace(_lAssignedToRole.Text)) { _lAssignedToRole.RenderControl(writer); } } writer.RenderEndTag(); // col-md-4 writer.AddAttribute(HtmlTextWriterAttribute.Class, "col-md-6"); writer.RenderBeginTag(HtmlTextWriterTag.Div); _cbActivityIsComplete.Enabled = CanEdit; _cbActivityIsComplete.ValidationGroup = ValidationGroup; _cbActivityIsComplete.RenderControl(writer); writer.AddAttribute(HtmlTextWriterAttribute.Class, "form-group"); writer.RenderBeginTag(HtmlTextWriterTag.Div); writer.AddAttribute(HtmlTextWriterAttribute.Class, "control-label"); writer.RenderBeginTag(HtmlTextWriterTag.Label); writer.Write(" "); writer.RenderEndTag(); // control-label _lState.RenderControl(writer); writer.RenderEndTag(); // form-group writer.RenderEndTag(); // col-md-6 writer.RenderEndTag(); // row _phAttributes.RenderControl(writer); // actions writer.RenderBeginTag("fieldset"); writer.RenderBeginTag("legend"); writer.WriteLine("Actions"); writer.RenderEndTag(); writer.AddAttribute(HtmlTextWriterAttribute.Class, "grid-table table table-condensed table-light"); writer.RenderBeginTag(HtmlTextWriterTag.Table); writer.RenderBeginTag(HtmlTextWriterTag.Thead); writer.RenderBeginTag(HtmlTextWriterTag.Tr); writer.AddAttribute(HtmlTextWriterAttribute.Scope, "col"); writer.RenderBeginTag(HtmlTextWriterTag.Th); writer.Write("Action"); writer.RenderEndTag(); writer.AddAttribute(HtmlTextWriterAttribute.Scope, "col"); writer.RenderBeginTag(HtmlTextWriterTag.Th); writer.Write("Last Processed"); writer.RenderEndTag(); writer.AddAttribute(HtmlTextWriterAttribute.Scope, "col"); writer.RenderBeginTag(HtmlTextWriterTag.Th); writer.Write("Completed"); writer.RenderEndTag(); writer.AddAttribute(HtmlTextWriterAttribute.Scope, "col"); writer.RenderBeginTag(HtmlTextWriterTag.Th); writer.RenderEndTag(); writer.RenderEndTag(); // tr writer.RenderEndTag(); // thead writer.AddAttribute(HtmlTextWriterAttribute.Class, "workflow-formfield-list"); writer.RenderBeginTag(HtmlTextWriterTag.Tbody); foreach (WorkflowActionEditor workflowActionEditor in this.Controls.OfType <WorkflowActionEditor>()) { workflowActionEditor.ValidationGroup = ValidationGroup; workflowActionEditor.RenderControl(writer); } writer.RenderEndTag(); // tbody writer.RenderEndTag(); // table // actions fieldset writer.RenderEndTag(); // widget-content div writer.RenderEndTag(); // section tag writer.RenderEndTag(); }
/// <summary> /// Writes the <see cref="T:System.Web.UI.WebControls.CompositeControl" /> content to the specified <see cref="T:System.Web.UI.HtmlTextWriter" /> object, for display on the client. /// </summary> /// <param name="writer">An <see cref="T:System.Web.UI.HtmlTextWriter" /> that represents the output stream to render HTML content on the client.</param> public override void RenderControl(HtmlTextWriter writer) { writer.AddAttribute(HtmlTextWriterAttribute.Class, "panel panel-widget checkin-grouptype"); writer.AddAttribute("data-key", _hfGroupTypeGuid.Value); writer.AddAttribute(HtmlTextWriterAttribute.Id, this.ID + "_section"); writer.RenderBeginTag("section"); writer.AddAttribute(HtmlTextWriterAttribute.Class, "panel-heading clearfix clickable"); writer.RenderBeginTag("header"); // Hidden Field to track expansion _hfExpanded.RenderControl(writer); writer.AddAttribute(HtmlTextWriterAttribute.Class, "filter-toggle pull-left"); writer.RenderBeginTag(HtmlTextWriterTag.Div); writer.AddAttribute(HtmlTextWriterAttribute.Class, "panel-title"); writer.RenderBeginTag(HtmlTextWriterTag.H3); _lblGroupTypeName.Text = _tbGroupTypeName.Text; _lblGroupTypeName.RenderControl(writer); // H3 tag writer.RenderEndTag(); // Name/Description div writer.RenderEndTag(); writer.AddAttribute(HtmlTextWriterAttribute.Class, "pull-right panel-actions"); writer.RenderBeginTag(HtmlTextWriterTag.Div); writer.WriteLine("<a class='btn btn-link btn-xs checkin-grouptype-reorder'><i class='fa fa-bars'></i></a>"); writer.WriteLine(string.Format("<a class='btn btn-xs btn-link'><i class='checkin-grouptype-state fa {0}'></i></a>", Expanded ? "fa fa-chevron-up" : "fa fa-chevron-down")); if (IsDeleteEnabled) { _lbDeleteGroupType.Visible = true; _lbDeleteGroupType.RenderControl(writer); } else { _lbDeleteGroupType.Visible = false; } // Add/ChevronUpDown/Delete div writer.RenderEndTag(); writer.AddAttribute(HtmlTextWriterAttribute.Class, "pull-right panel-actions btn-group"); writer.RenderBeginTag(HtmlTextWriterTag.Div); _lbAddCheckinGroupType.RenderControl(writer); writer.WriteLine(); _lbAddCheckinGroup.RenderControl(writer); writer.WriteLine(); writer.RenderEndTag(); // header div writer.RenderEndTag(); writer.AddAttribute(HtmlTextWriterAttribute.Class, "panel-body"); if (!Expanded) { writer.AddStyleAttribute("display", "none"); } writer.RenderBeginTag(HtmlTextWriterTag.Div); // make two span6 columns: Left Column for Name and Attributes. Right Column for Labels Grid writer.AddAttribute(HtmlTextWriterAttribute.Class, "row"); writer.RenderBeginTag(HtmlTextWriterTag.Div); writer.AddAttribute(HtmlTextWriterAttribute.Class, "col-sm-6"); writer.RenderBeginTag(HtmlTextWriterTag.Div); // grouptype edit fields _tbGroupTypeName.RenderControl(writer); _ddlGroupTypeInheritFrom.RenderControl(writer); // attributes _phGroupTypeAttributes.RenderControl(writer); writer.RenderEndTag(); writer.AddAttribute(HtmlTextWriterAttribute.Class, "col-sm-6"); writer.RenderBeginTag(HtmlTextWriterTag.Div); // Check-in Labels grid writer.WriteLine("<h3>Check-in Labels</h3>"); _gCheckinLabels.DataSource = this.CheckinLabels; _gCheckinLabels.DataBind(); _gCheckinLabels.RenderControl(writer); // span6 writer.RenderEndTag(); // rowfluid writer.RenderEndTag(); // groups writer.AddAttribute(HtmlTextWriterAttribute.Class, "checkin-grouptype-list"); writer.RenderBeginTag(HtmlTextWriterTag.Div); foreach (CheckinGroupTypeEditor checkinGroupTypeEditor in this.Controls.OfType <CheckinGroupTypeEditor>()) { checkinGroupTypeEditor.RenderControl(writer); } // checkin-grouptype-list div writer.RenderEndTag(); writer.AddAttribute(HtmlTextWriterAttribute.Class, "checkin-group-list"); writer.RenderBeginTag(HtmlTextWriterTag.Div); foreach (CheckinGroupEditor checkinGroupEditor in this.Controls.OfType <CheckinGroupEditor>()) { checkinGroupEditor.RenderControl(writer); } // checkin-group-list div writer.RenderEndTag(); // widget-content div writer.RenderEndTag(); // section tag writer.RenderEndTag(); }
/// <summary> /// Writes the <see cref="T:System.Web.UI.WebControls.CompositeControl" /> content to the specified <see cref="T:System.Web.UI.HtmlTextWriter" /> object, for display on the client. /// </summary> /// <param name="writer">An <see cref="T:System.Web.UI.HtmlTextWriter" /> that represents the output stream to render HTML content on the client.</param> public override void RenderControl(HtmlTextWriter writer) { writer.AddAttribute(HtmlTextWriterAttribute.Class, "panel panel-widget workflow-action"); writer.AddAttribute("data-key", _hfActionTypeGuid.Value); writer.RenderBeginTag("article"); writer.AddAttribute(HtmlTextWriterAttribute.Class, "clearfix clickable panel-heading"); writer.RenderBeginTag("header"); // Hidden Field to track expansion _hfExpanded.RenderControl(writer); writer.AddAttribute(HtmlTextWriterAttribute.Class, "pull-left workflow-action-name"); writer.RenderBeginTag(HtmlTextWriterTag.Div); _lblActionTypeName.Text = _tbActionTypeName.Text; _lblActionTypeName.RenderControl(writer); writer.RenderEndTag(); writer.AddAttribute(HtmlTextWriterAttribute.Class, "pull-right"); writer.RenderBeginTag(HtmlTextWriterTag.Div); string criteriaExistsClass = _ddlCriteriaAttribute.SelectedValueAsGuid().HasValue ? " criteria-exists" : string.Empty; writer.WriteLine(string.Format("<a class='btn btn-xs btn-link js-workflow-action-criteria{0}'><i class='fa fa-filter'></i></a>", criteriaExistsClass)); writer.WriteLine("<a class='btn btn-xs btn-link workflow-action-reorder'><i class='fa fa-bars'></i></a>"); writer.WriteLine(string.Format("<a class='btn btn-xs btn-link'><i class='workflow-action-state fa {0}'></i></a>", Expanded ? "fa fa-chevron-up" : "fa fa-chevron-down")); if (IsDeleteEnabled) { _lbDeleteActionType.Visible = true; _lbDeleteActionType.RenderControl(writer); } else { _lbDeleteActionType.Visible = false; } // Add/ChevronUpDown/Delete div writer.RenderEndTag(); // header div writer.RenderEndTag(); if (!Expanded) { // hide details if the name has already been filled in writer.AddStyleAttribute("display", "none"); } writer.AddAttribute(HtmlTextWriterAttribute.Class, "panel-body"); writer.RenderBeginTag(HtmlTextWriterTag.Div); // add Criteria fields writer.AddAttribute(HtmlTextWriterAttribute.Class, "row conditional-run-criteria alert-warning"); if (!_ddlCriteriaAttribute.SelectedValueAsGuid().HasValue) { writer.AddStyleAttribute("display", "none"); } writer.RenderBeginTag(HtmlTextWriterTag.Div); writer.AddAttribute(HtmlTextWriterAttribute.Class, "col-lg-6"); writer.RenderBeginTag(HtmlTextWriterTag.Div); writer.AddAttribute(HtmlTextWriterAttribute.Class, "row"); writer.RenderBeginTag(HtmlTextWriterTag.Div); writer.AddAttribute(HtmlTextWriterAttribute.Class, "col-xs-7"); writer.RenderBeginTag(HtmlTextWriterTag.Div); _ddlCriteriaAttribute.RenderControl(writer); writer.RenderEndTag(); writer.AddAttribute(HtmlTextWriterAttribute.Class, "col-xs-5"); writer.RenderBeginTag(HtmlTextWriterTag.Div); _ddlCriteriaComparisonType.RenderControl(writer); writer.RenderEndTag(); writer.RenderEndTag(); // row writer.RenderEndTag(); // col-md-6 writer.AddAttribute(HtmlTextWriterAttribute.Class, "col-lg-6"); writer.RenderBeginTag(HtmlTextWriterTag.Div); var comparisonType = _ddlCriteriaComparisonType.SelectedValueAsEnum <ComparisonType>(); _tbddlCriteriaValue.Style["display"] = (comparisonType == ComparisonType.IsBlank || comparisonType == ComparisonType.IsNotBlank) ? "none" : "block"; _tbddlCriteriaValue.RenderControl(writer); writer.RenderEndTag(); writer.RenderEndTag(); // action edit fields writer.AddAttribute(HtmlTextWriterAttribute.Class, "row"); writer.RenderBeginTag(HtmlTextWriterTag.Div); writer.AddAttribute(HtmlTextWriterAttribute.Class, "col-md-6"); writer.RenderBeginTag(HtmlTextWriterTag.Div); _tbActionTypeName.ValidationGroup = ValidationGroup; _tbActionTypeName.RenderControl(writer); _ddlEntityType.ValidationGroup = ValidationGroup; _ddlEntityType.RenderControl(writer); writer.RenderEndTag(); writer.AddAttribute(HtmlTextWriterAttribute.Class, "col-md-6"); writer.RenderBeginTag(HtmlTextWriterTag.Div); _cbIsActionCompletedOnSuccess.ValidationGroup = ValidationGroup; _cbIsActionCompletedOnSuccess.RenderControl(writer); _cbIsActivityCompletedOnSuccess.ValidationGroup = ValidationGroup; _cbIsActivityCompletedOnSuccess.RenderControl(writer); writer.RenderEndTag(); writer.RenderEndTag(); _formEditor.ValidationGroup = ValidationGroup; _formEditor.RenderControl(writer); _phActionAttributes.RenderControl(writer); // widget-content div writer.RenderEndTag(); // article tag writer.RenderEndTag(); }
/// <summary> /// Writes the <see cref="T:System.Web.UI.WebControls.CompositeControl" /> content to the specified <see cref="T:System.Web.UI.HtmlTextWriter" /> object, for display on the client. /// </summary> /// <param name="writer">An <see cref="T:System.Web.UI.HtmlTextWriter" /> that represents the output stream to render HTML content on the client.</param> protected override void Render(HtmlTextWriter writer) { writer.RenderBeginTag(HtmlTextWriterTag.Fieldset); writer.RenderBeginTag(HtmlTextWriterTag.Legend); _lAttributeActionTitle.RenderControl(writer); writer.RenderEndTag(); _validationSummary.RenderControl(writer); // row 1 writer.AddAttribute(HtmlTextWriterAttribute.Class, "row"); writer.RenderBeginTag(HtmlTextWriterTag.Div); writer.AddAttribute(HtmlTextWriterAttribute.Class, "col-md-6"); writer.RenderBeginTag(HtmlTextWriterTag.Div); _tbName.RenderControl(writer); writer.RenderEndTag(); writer.RenderEndTag(); // row 2 writer.AddAttribute(HtmlTextWriterAttribute.Class, "row"); writer.RenderBeginTag(HtmlTextWriterTag.Div); writer.AddAttribute(HtmlTextWriterAttribute.Class, "col-md-12"); writer.RenderBeginTag(HtmlTextWriterTag.Div); _tbDescription.RenderControl(writer); writer.RenderEndTag(); writer.RenderEndTag(); // row 3 writer.AddAttribute(HtmlTextWriterAttribute.Class, "row"); writer.RenderBeginTag(HtmlTextWriterTag.Div); // row 3 col 1 writer.AddAttribute(HtmlTextWriterAttribute.Class, "col-md-6"); writer.RenderBeginTag(HtmlTextWriterTag.Div); _cpCategories.RenderControl(writer); _tbKey.RenderControl(writer); _cvKey.RenderControl(writer); _cbRequired.RenderControl(writer); _cbShowInGrid.RenderControl(writer); writer.RenderEndTag(); // row 3 col 2 writer.AddAttribute(HtmlTextWriterAttribute.Class, "col-md-6"); writer.RenderBeginTag(HtmlTextWriterTag.Div); _ddlFieldType.RenderControl(writer); _phQualifiers.RenderControl(writer); _phDefaultValue.RenderControl(writer); writer.RenderEndTag(); writer.RenderEndTag(); // </fieldset> writer.RenderEndTag(); if (ShowActions) { writer.AddAttribute(HtmlTextWriterAttribute.Class, "actions"); writer.RenderBeginTag(HtmlTextWriterTag.Div); _btnSave.RenderControl(writer); writer.Write(Environment.NewLine); _btnCancel.RenderControl(writer); writer.RenderEndTag(); } RegisterClientScript(); }
/// <summary> /// Writes the <see cref="T:System.Web.UI.WebControls.CompositeControl" /> content to the specified <see cref="T:System.Web.UI.HtmlTextWriter" /> object, for display on the client. /// </summary> /// <param name="writer">An <see cref="T:System.Web.UI.HtmlTextWriter" /> that represents the output stream to render HTML content on the client.</param> public override void RenderControl(HtmlTextWriter writer) { writer.AddAttribute(HtmlTextWriterAttribute.Class, GenerateActionCssClass()); writer.AddAttribute("data-key", _hfActionTypeGuid.Value); writer.RenderBeginTag("article"); writer.AddAttribute(HtmlTextWriterAttribute.Class, IsEditable ? "panel-heading clickable clearfix" : "panel-heading clearfix"); writer.RenderBeginTag("header"); // Hidden Field to track expansion _hfExpanded.RenderControl(writer); writer.AddAttribute(HtmlTextWriterAttribute.Class, "workflow-action-name pull-left"); writer.RenderBeginTag(HtmlTextWriterTag.Div); _lblActionTypeName.Text = _tbActionTypeName.Text; _lblActionTypeName.RenderControl(writer); writer.RenderEndTag(); // Hide edit controls if the action doesn't support editing if (IsEditable) { writer.AddAttribute(HtmlTextWriterAttribute.Class, "pull-right"); writer.RenderBeginTag(HtmlTextWriterTag.Div); string criteriaExistsClass = _ddlCriteriaAttribute.SelectedValueAsGuid().HasValue ? " criteria-exists" : string.Empty; writer.WriteLine(string.Format("<a class='btn btn-xs btn-link js-workflow-action-criteria{0}'><i class='fa fa-filter'></i></a>", criteriaExistsClass)); writer.WriteLine("<a class='btn btn-xs btn-link workflow-action-reorder'><i class='fa fa-bars'></i></a>"); writer.WriteLine(string.Format("<a class='btn btn-xs btn-link'><i class='workflow-action-state fa {0}'></i></a>", Expanded ? "fa fa-chevron-up" : "fa fa-chevron-down")); if (IsDeleteEnabled) { _lbDeleteActionType.Visible = true; _lbDeleteActionType.RenderControl(writer); } else { _lbDeleteActionType.Visible = false; } // Add/ChevronUpDown/Delete div writer.RenderEndTag(); } // header div writer.RenderEndTag(); if (!Expanded) { // hide details if the name has already been filled in writer.AddStyleAttribute("display", "none"); } writer.AddAttribute(HtmlTextWriterAttribute.Class, "panel-body"); writer.RenderBeginTag(HtmlTextWriterTag.Div); // add Criteria fields writer.AddAttribute(HtmlTextWriterAttribute.Class, "row conditional-run-criteria alert-warning"); if (!_ddlCriteriaAttribute.SelectedValueAsGuid().HasValue) { writer.AddStyleAttribute("display", "none"); } writer.RenderBeginTag(HtmlTextWriterTag.Div); writer.AddAttribute(HtmlTextWriterAttribute.Class, "col-lg-6"); writer.RenderBeginTag(HtmlTextWriterTag.Div); writer.AddAttribute(HtmlTextWriterAttribute.Class, "form-row"); writer.RenderBeginTag(HtmlTextWriterTag.Div); writer.AddAttribute(HtmlTextWriterAttribute.Class, "col-xs-7"); writer.RenderBeginTag(HtmlTextWriterTag.Div); _ddlCriteriaAttribute.RenderControl(writer); writer.RenderEndTag(); writer.AddAttribute(HtmlTextWriterAttribute.Class, "col-xs-5"); writer.RenderBeginTag(HtmlTextWriterTag.Div); _ddlCriteriaComparisonType.RenderControl(writer); writer.RenderEndTag(); writer.RenderEndTag(); // row writer.RenderEndTag(); // col-md-6 writer.AddAttribute(HtmlTextWriterAttribute.Class, "col-lg-6"); writer.RenderBeginTag(HtmlTextWriterTag.Div); var comparisonType = _ddlCriteriaComparisonType.SelectedValueAsEnum <ComparisonType>(); _tbddlCriteriaValue.Style["display"] = (comparisonType == ComparisonType.IsBlank || comparisonType == ComparisonType.IsNotBlank) ? "none" : "block"; _tbddlCriteriaValue.RenderControl(writer); writer.RenderEndTag(); writer.RenderEndTag(); // action edit fields writer.AddAttribute(HtmlTextWriterAttribute.Class, "form-row"); writer.RenderBeginTag(HtmlTextWriterTag.Div); writer.AddAttribute(HtmlTextWriterAttribute.Class, "col-md-6"); writer.RenderBeginTag(HtmlTextWriterTag.Div); _tbActionTypeName.ValidationGroup = ValidationGroup; _tbActionTypeName.RenderControl(writer); writer.RenderEndTag(); writer.AddAttribute(HtmlTextWriterAttribute.Class, "col-md-6 control-label-offset"); writer.RenderBeginTag(HtmlTextWriterTag.Div); writer.AddAttribute(HtmlTextWriterAttribute.Class, "form-group"); writer.RenderBeginTag(HtmlTextWriterTag.Div); _cbIsActionCompletedOnSuccess.ValidationGroup = ValidationGroup; _cbIsActionCompletedOnSuccess.RenderControl(writer); _cbIsActivityCompletedOnSuccess.ValidationGroup = ValidationGroup; _cbIsActivityCompletedOnSuccess.RenderControl(writer); writer.RenderEndTag(); writer.RenderEndTag(); writer.RenderEndTag(); // row writer.AddAttribute(HtmlTextWriterAttribute.Class, "row"); writer.RenderBeginTag(HtmlTextWriterTag.Div); writer.AddAttribute(HtmlTextWriterAttribute.Class, "col-lg-4"); writer.RenderBeginTag(HtmlTextWriterTag.Div); _wfatpEntityType.ValidationGroup = ValidationGroup; _wfatpEntityType.RenderControl(writer); writer.RenderEndTag(); // Add an overview(description) of the selected action type writer.AddAttribute(HtmlTextWriterAttribute.Class, "col-lg-8"); writer.RenderBeginTag(HtmlTextWriterTag.Div); EntityTypeCache entityType = null; int? entityTypeId = _wfatpEntityType.SelectedValueAsInt(); if (entityTypeId.HasValue) { entityType = EntityTypeCache.Get(entityTypeId.Value); if (entityType != null) { var component = ActionContainer.GetComponent(entityType.Name); if (component != null) { string description = string.Empty; var propAttribute = component.GetType().GetCustomAttributes(typeof(System.ComponentModel.DescriptionAttribute), false).FirstOrDefault(); if (propAttribute != null) { var descAttribute = propAttribute as System.ComponentModel.DescriptionAttribute; if (descAttribute != null) { _rlEntityTypeOverview.Label = string.Format("'{0}' Overview", entityType.FriendlyName); _rlEntityTypeOverview.Text = descAttribute.Description; _rlEntityTypeOverview.RenderControl(writer); } } } } } writer.RenderEndTag(); // col-md-8 writer.RenderEndTag(); // row if (entityType != null && entityType.Name == typeof(Rock.Workflow.Action.UserEntryForm).FullName) { _formEditor.ValidationGroup = ValidationGroup; _formEditor.RenderControl(writer); } _phActionAttributes.RenderControl(writer); // widget-content div writer.RenderEndTag(); // article tag writer.RenderEndTag(); }
/// <summary> /// Writes the <see cref="T:System.Web.UI.WebControls.CompositeControl" /> content to the specified <see cref="T:System.Web.UI.HtmlTextWriter" /> object, for display on the client. /// </summary> /// <param name="writer">An <see cref="T:System.Web.UI.HtmlTextWriter" /> that represents the output stream to render HTML content on the client.</param> protected override void Render(HtmlTextWriter writer) { writer.RenderBeginTag(HtmlTextWriterTag.Fieldset); writer.RenderBeginTag(HtmlTextWriterTag.Legend); _lAttributeActionTitle.RenderControl(writer); writer.RenderEndTag(); var existingKeyNames = new List <string>(); ReservedKeyNames.ForEach(n => existingKeyNames.Add(n)); ObjectPropertyNames.ForEach(n => existingKeyNames.Add(n)); _hfExistingKeyNames.Value = existingKeyNames.ToJson(); _hfExistingKeyNames.RenderControl(writer); _validationSummary.RenderControl(writer); // row 1 writer.AddAttribute(HtmlTextWriterAttribute.Class, "row"); writer.RenderBeginTag(HtmlTextWriterTag.Div); writer.AddAttribute(HtmlTextWriterAttribute.Class, "col-md-6"); writer.RenderBeginTag(HtmlTextWriterTag.Div); _tbName.RenderControl(writer); writer.RenderEndTag(); writer.RenderEndTag(); // row 2 writer.AddAttribute(HtmlTextWriterAttribute.Class, "row"); writer.RenderBeginTag(HtmlTextWriterTag.Div); writer.AddAttribute(HtmlTextWriterAttribute.Class, "col-md-12"); writer.RenderBeginTag(HtmlTextWriterTag.Div); _tbDescription.RenderControl(writer); writer.RenderEndTag(); writer.RenderEndTag(); // row 3 writer.AddAttribute(HtmlTextWriterAttribute.Class, "row"); writer.RenderBeginTag(HtmlTextWriterTag.Div); // row 3 col 1 writer.AddAttribute(HtmlTextWriterAttribute.Class, "col-md-6"); writer.RenderBeginTag(HtmlTextWriterTag.Div); _cpCategories.RenderControl(writer); _tbKey.RenderControl(writer); _cvKey.RenderControl(writer); _tbIconCssClass.RenderControl(writer); _cbRequired.RenderControl(writer); _cbShowInGrid.RenderControl(writer); writer.RenderEndTag(); // row 3 col 2 writer.AddAttribute(HtmlTextWriterAttribute.Class, "col-md-6"); writer.RenderBeginTag(HtmlTextWriterTag.Div); _ddlFieldType.RenderControl(writer); _phQualifiers.RenderControl(writer); _phDefaultValue.RenderControl(writer); writer.RenderEndTag(); writer.RenderEndTag(); // </fieldset> writer.RenderEndTag(); if (ShowActions) { writer.AddAttribute(HtmlTextWriterAttribute.Class, "actions"); writer.RenderBeginTag(HtmlTextWriterTag.Div); _btnSave.RenderControl(writer); writer.Write(Environment.NewLine); _btnCancel.RenderControl(writer); writer.RenderEndTag(); } RegisterClientScript(); }
/// <summary> /// Outputs server control content to a provided <see cref="T:System.Web.UI.HtmlTextWriter" /> object and stores tracing information about the control if tracing is enabled. /// </summary> /// <param name="writer">The <see cref="T:System.Web.UI.HtmlTextWriter" /> object that receives the control content.</param> public override void RenderControl(HtmlTextWriter writer) { if (this.Visible) { writer.AddAttribute("rowid", ID); writer.RenderBeginTag(HtmlTextWriterTag.Tr); writer.RenderBeginTag(HtmlTextWriterTag.Td); writer.AddAttribute(HtmlTextWriterAttribute.Class, "form-group" + (_rblRole.IsValid ? "" : " has-error")); writer.RenderBeginTag(HtmlTextWriterTag.Div); _rblRole.RenderControl(writer); writer.RenderEndTag(); writer.RenderEndTag(); writer.RenderBeginTag(HtmlTextWriterTag.Td); _ddlTitle.RenderControl(writer); writer.RenderEndTag(); writer.RenderBeginTag(HtmlTextWriterTag.Td); writer.AddAttribute(HtmlTextWriterAttribute.Class, "form-group" + (_tbFirstName.IsValid ? "" : " has-error")); writer.RenderBeginTag(HtmlTextWriterTag.Div); _tbFirstName.RenderControl(writer); writer.RenderEndTag(); writer.RenderEndTag(); if (ShowNickName) { writer.RenderBeginTag(HtmlTextWriterTag.Td); _tbNickName.RenderControl(writer); writer.RenderEndTag(); } writer.RenderBeginTag(HtmlTextWriterTag.Td); writer.AddAttribute(HtmlTextWriterAttribute.Class, "form-group" + (_tbLastName.IsValid ? "" : " has-error")); writer.RenderBeginTag(HtmlTextWriterTag.Div); _tbLastName.RenderControl(writer); writer.RenderEndTag(); writer.RenderEndTag(); writer.RenderBeginTag(HtmlTextWriterTag.Td); writer.AddAttribute(HtmlTextWriterAttribute.Class, "form-group" + (_rblGender.IsValid ? "" : " has-error")); writer.RenderBeginTag(HtmlTextWriterTag.Div); _rblGender.RenderControl(writer); writer.RenderEndTag(); writer.RenderEndTag(); writer.RenderBeginTag(HtmlTextWriterTag.Td); _dpBirthdate.RenderControl(writer); writer.RenderEndTag(); writer.RenderBeginTag(HtmlTextWriterTag.Td); _ddlConnectionStatus.RenderControl(writer); writer.RenderEndTag(); writer.RenderBeginTag(HtmlTextWriterTag.Td); if (ShowGrade) { _ddlGrade.RenderControl(writer); } writer.RenderEndTag(); writer.RenderBeginTag(HtmlTextWriterTag.Td); _lbDelete.RenderControl(writer); writer.RenderEndTag(); writer.RenderEndTag(); } }
/// <summary> /// Writes the <see cref="T:System.Web.UI.WebControls.CompositeControl" /> content to the specified <see cref="T:System.Web.UI.HtmlTextWriter" /> object, for display on the client. /// </summary> /// <param name="writer">An <see cref="T:System.Web.UI.HtmlTextWriter" /> that represents the output stream to render HTML content on the client.</param> public override void RenderControl(HtmlTextWriter writer) { writer.AddAttribute(HtmlTextWriterAttribute.Class, "panel panel-widget workflow-action"); writer.AddAttribute("data-key", _hfActionTypeGuid.Value); writer.RenderBeginTag("article"); writer.AddAttribute(HtmlTextWriterAttribute.Class, "clearfix clickable panel-heading"); writer.RenderBeginTag("header"); writer.AddAttribute(HtmlTextWriterAttribute.Class, "pull-left"); writer.RenderBeginTag(HtmlTextWriterTag.Div); _lblActionTypeName.Text = _tbActionTypeName.Text; _lblActionTypeName.RenderControl(writer); writer.RenderEndTag(); writer.AddAttribute(HtmlTextWriterAttribute.Class, "pull-right"); writer.RenderBeginTag(HtmlTextWriterTag.Div); writer.WriteLine("<a class='btn btn-xs btn-link workflow-action-reorder'><i class='fa fa-bars'></i></a>"); writer.WriteLine("<a class='btn btn-xs btn-link'><i class='workflow-action-state fa fa-chevron-down'></i></a>"); if (IsDeleteEnabled) { _lbDeleteActionType.Visible = true; _lbDeleteActionType.RenderControl(writer); } else { _lbDeleteActionType.Visible = false; } // Add/ChevronUpDown/Delete div writer.RenderEndTag(); // header div writer.RenderEndTag(); writer.AddAttribute(HtmlTextWriterAttribute.Class, "panel-body"); bool forceContentVisible = !WorkflowActionType.IsValid || ForceContentVisible; if (!forceContentVisible) { // hide details if the name has already been filled in writer.AddStyleAttribute("display", "none"); } writer.RenderBeginTag(HtmlTextWriterTag.Div); // action edit fields _tbActionTypeName.RenderControl(writer); _ddlEntityType.RenderControl(writer); _cbIsActionCompletedOnSuccess.RenderControl(writer); _cbIsActivityCompletedOnSuccess.RenderControl(writer); // action attributes _phActionAttributes.RenderControl(writer); // widget-content div writer.RenderEndTag(); // article tag writer.RenderEndTag(); }