Example #1
0
        public override string GetFieldValueAsText(object value)
        {
            HTML5DetailsField field = (HTML5DetailsField)value;

            if (field != null)
            {
                return(field.ToString());
            }
            return(string.Empty);
        }
        protected override void CreateChildControls()
        {
            this.DisableInputFieldLabel = true;
            base.ControlMode            = SPContext.Current.FormContext.FormMode;
            base.CreateChildControls();
            detailsField = (HTML5DetailsField)ItemFieldValue;

            if (detailsField == null)
            {
                detailsField = new HTML5DetailsField();
            }

            if (base.ControlMode == SPControlMode.Edit || base.ControlMode == SPControlMode.New)
            {
                //html_summery = (InputFormTextBox)this.TemplateContainer.FindControl("html_summery");
                //html_summery.Text = detailsField.Summery;

                //html_text = (InputFormTextBox)this.TemplateContainer.FindControl("html_text");
                //html_text.Text = detailsField.Text;

                html_details_hidden       = (HiddenField)this.TemplateContainer.FindControl("html_header_hidden");
                html_details_hidden.Value = detailsField.Text;

                html_details = (Details)this.TemplateContainer.FindControl("html_details");
                html_details.Controls.AddAt(0, new LiteralControl {
                    Text = detailsField.Text
                });
            }
            else
            {
                html_details = (Details)this.TemplateContainer.FindControl("html_details");
                html_details.Controls.AddAt(0, new LiteralControl {
                    Text = detailsField.Text
                });

                //html_details = (Details)this.TemplateContainer.FindControl("html_details");
            }
        }