public TagBuilder_RadioGroup(DynamicComponentBaseFor <TModel, TProperty> dynamicComponentBase)
     : base("fieldset", dynamicComponentBase)
 {
     /* Adicionar os atributos de acordo com o que for obtido no HtmlAttributes... */
     TagElement.MergeInputAttributeHtmlAttributes("class", this.ComponentBase.HtmlAttributes);
     TagElement.MergeInputAttributeHtmlAttributes("style", this.ComponentBase.HtmlAttributes);
 }
        public TagBuilder_TextArea(DynamicComponentBaseFor <TModel, TProperty> dynamicComponentBase)
            : base("textarea", dynamicComponentBase)
        {
            /* Adicionar os atributos de acordo com o que for obtido no Metadata... */
            //TagElement.AddInputTypeAttribute(fieldType);
            TagElement.AddInputAttributeIsNotNull("type", CustomAttributesHelpers.ConvertDataTypeToHtmlType((DataType)this.ComponentBase.MetadataAttributes.GetValue <DataType>("DataType", "DataType"), this.ComponentBase.FieldType));
            int?minimumLength = (int?)this.ComponentBase.MetadataAttributes.GetValue <DataType>("Minimum", "Length") ?? (int?)this.ComponentBase.MetadataAttributes.GetValue <DataType>("StringLength", "MinimumLength");

            TagElement.AddInputAttributeIsNotNullAndExpressionIsTrue("minlength", minimumLength, minimumLength.HasValue && minimumLength.Value > 0);
            int?maximumLength = (int?)this.ComponentBase.MetadataAttributes.GetValue <DataType>("Maximum", "Length") ?? (int?)this.ComponentBase.MetadataAttributes.GetValue <DataType>("StringLength", "MaximumLength");

            TagElement.AddInputAttributeIsNotNullAndExpressionIsTrue("maxlength", maximumLength, maximumLength.HasValue && maximumLength.Value > 0);
            TagElement.MergeInputAttributeIsNotNull("class", this.ComponentBase.MetadataAttributes.GetValue <object>("OnlyNumber", "ClassDecorator"));
            TagElement.MergeInputAttributeIsNotNull("class", this.ComponentBase.MetadataAttributes.GetValue <object>("NoEspecialChars", "ClassDecorator"));
            TagElement.AddInputAttributeIsNotNull("cols", this.ComponentBase.MetadataAttributes.GetValue <object>("TextArea", "Cols"));
            TagElement.AddInputAttributeIsNotNull("rows", this.ComponentBase.MetadataAttributes.GetValue <object>("TextArea", "Rows"));
            TagElement.AddInputAttributeIsNotNull("wrap", this.ComponentBase.MetadataAttributes.GetValue <object>("TextArea", "Wrap"));
            TagElement.AddInputAttributeIsNotNull("minlength", this.ComponentBase.MetadataAttributes.GetValue <object>("TextArea", "MinLength"));
            TagElement.AddInputAttributeIsNotNull("maxlength", this.ComponentBase.MetadataAttributes.GetValue <object>("TextArea", "MaxLength"));

            /* Adicionar os atributos de acordo com o que for obtido no HtmlAttributes... */
            TagElement.MergeInputAttributeHtmlAttributes("class", this.ComponentBase.HtmlAttributes);
            TagElement.MergeInputAttributeHtmlAttributes("style", this.ComponentBase.HtmlAttributes);
            TagElement.AddInputAttributeHtmlAttributes("type", this.ComponentBase.HtmlAttributes);
            TagElement.AddInputAttributeHtmlAttributes("minlength", this.ComponentBase.HtmlAttributes);
            TagElement.AddInputAttributeHtmlAttributes("maxlength", this.ComponentBase.HtmlAttributes);
            TagElement.AddInputAttributeHtmlAttributes("cols", this.ComponentBase.HtmlAttributes);
            TagElement.AddInputAttributeHtmlAttributes("rows", this.ComponentBase.HtmlAttributes);
            TagElement.AddInputAttributeHtmlAttributes("wrap", this.ComponentBase.HtmlAttributes);

            /* Injetando o Valor no Input... */
            this.Value = this.ComponentBase.FieldValue;
            TagElement.AddInputAttributeIsNotNull("value", this.Value);
            TagElement.InnerHtml = this.Value?.ToString();
        }
Exemplo n.º 3
0
        public TagBuilder_Progress(DynamicComponentBaseFor <TModel, TProperty> dynamicComponentBase)
            : base("progress", dynamicComponentBase)
        {
            /* Adicionar os atributos de acordo com o que for obtido no Metadata... */
            //TagElement.AddInputTypeAttribute(fieldType);
            int?minimumLength = (int?)this.ComponentBase.MetadataAttributes.GetValue <DataType>("Minimum", "Length") ?? (int?)this.ComponentBase.MetadataAttributes.GetValue <DataType>("StringLength", "MinimumLength");

            TagElement.AddInputAttributeIsNotNullAndExpressionIsTrue("minlength", minimumLength, minimumLength.HasValue && minimumLength.Value > 0);
            int?maximumLength = (int?)this.ComponentBase.MetadataAttributes.GetValue <DataType>("Maximum", "Length") ?? (int?)this.ComponentBase.MetadataAttributes.GetValue <DataType>("StringLength", "MaximumLength");

            TagElement.AddInputAttributeIsNotNullAndExpressionIsTrue("maxlength", maximumLength, maximumLength.HasValue && maximumLength.Value > 0);

            /* Adicionar os atributos de acordo com o que for obtido no HtmlAttributes... */
            TagElement.MergeInputAttributeHtmlAttributes("class", this.ComponentBase.HtmlAttributes);
            //TagElement.DeleteValueInAttribute("class", "form-control");
            TagElement.MergeInputAttributeHtmlAttributes("style", this.ComponentBase.HtmlAttributes);
            TagElement.AddInputAttributeHtmlAttributes("minlength", this.ComponentBase.HtmlAttributes);
            TagElement.AddInputAttributeHtmlAttributes("maxlength", this.ComponentBase.HtmlAttributes);

            /* Injetando o Valor no Input... */
            double?maxValue = this.ComponentBase.MetadataAttributes.GetValue <double>("ProgressAttribute", "MaxValue");

            TagElement.AddInputAttributeIsNotNullAndExpressionIsTrue("max", maxValue, maxValue != null);
            this.Value = this.ComponentBase.FieldValue;
            TagElement.AddInputAttributeIsNotNullAndExpressionIsTrue("value", this.Value, this.Value != null);
        }
Exemplo n.º 4
0
        public TagBuilder_Password(DynamicComponentBaseFor <TModel, TProperty> dynamicComponentBase)
            : base("input", dynamicComponentBase)
        {
            /* Adicionar os atributos de acordo com o que for obtido no Metadata... */
            //TagElement.AddInputTypeAttribute(fieldType);
            TagElement.AddInputAttributeStaticValue("type", "password");
            int?minimumLength = (int?)this.ComponentBase.MetadataAttributes.GetValue <DataType>("Minimum", "Length") ?? (int?)this.ComponentBase.MetadataAttributes.GetValue <DataType>("StringLength", "MinimumLength");

            TagElement.AddInputAttributeIsNotNullAndExpressionIsTrue("minlength", minimumLength, minimumLength.HasValue && minimumLength.Value > 0);
            int?maximumLength = (int?)this.ComponentBase.MetadataAttributes.GetValue <DataType>("Maximum", "Length") ?? (int?)this.ComponentBase.MetadataAttributes.GetValue <DataType>("StringLength", "MaximumLength");

            TagElement.AddInputAttributeIsNotNullAndExpressionIsTrue("maxlength", maximumLength, maximumLength.HasValue && maximumLength.Value > 0);
            TagElement.MergeInputAttributeIsNotNull("class", this.ComponentBase.MetadataAttributes.GetValue <object>("OnlyNumber", "ClassDecorator"));
            TagElement.MergeInputAttributeIsNotNull("class", this.ComponentBase.MetadataAttributes.GetValue <object>("Currency", "ClassDecorator"));
            TagElement.MergeInputAttributeIsNotNull("pattern", this.ComponentBase.MetadataAttributes.GetValue <object>("Currency", "Pattern"));
            TagElement.MergeInputAttributeIsNotNull("class", this.ComponentBase.MetadataAttributes.GetValue <object>("NoEspecialChars", "ClassDecorator"));

            /* Adicionar os atributos de acordo com o que for obtido no HtmlAttributes... */
            TagElement.MergeInputAttributeHtmlAttributes("class", this.ComponentBase.HtmlAttributes);
            TagElement.MergeInputAttributeHtmlAttributes("style", this.ComponentBase.HtmlAttributes);
            TagElement.AddInputAttributeHtmlAttributes("minlength", this.ComponentBase.HtmlAttributes);
            TagElement.AddInputAttributeHtmlAttributes("maxlength", this.ComponentBase.HtmlAttributes);

            /* Injetando o Valor no Input... */
            this.Value = this.ComponentBase.FieldValue;
            TagElement.AddInputAttributeIsNotNull("value", this.Value);
        }
Exemplo n.º 5
0
        public TagBuilder_Select(DynamicComponentBaseFor <TModel, TProperty> dynamicComponentBase)
            : base("select", dynamicComponentBase)
        {
            /* Adicionar os atributos de acordo com o que for obtido no HtmlAttributes... */
            TagElement.MergeInputAttributeHtmlAttributes("class", this.ComponentBase.HtmlAttributes);
            TagElement.MergeInputAttributeHtmlAttributes("style", this.ComponentBase.HtmlAttributes);

            /* Injetando o Valor no Input... */
            this.Value = this.ComponentBase.FieldValue;
            TagElement.AddInputAttributeIsNotNull("value", this.Value);
        }
Exemplo n.º 6
0
        public TagBuilder_Checkbox(DynamicComponentBaseFor <TModel, TProperty> dynamicComponentBase)
            : base(CustomAttributesHelpers.GetInputElementTypeByDataType((DataType)dynamicComponentBase.MetadataAttributes.GetValue <DataType>("DataType", "DataType")), dynamicComponentBase)
        {
            /* Adicionar os atributos de acordo com o que for obtido no Metadata... */
            TagElement.AddInputAttributeStaticValue("type", "checkbox");

            /* Adicionar os atributos de acordo com o que for obtido no HtmlAttributes... */
            TagElement.MergeInputAttributeHtmlAttributes("class", this.ComponentBase.HtmlAttributes);
            TagElement.MergeInputAttributeHtmlAttributes("style", this.ComponentBase.HtmlAttributes);

            /* Injetando o Valor no Input... */
            this.Value = this.ComponentBase.FieldValue;
            TagElement.AddInputAttributeIsNotNull("value", this.Value);
        }
        public TagBuilder_Range(DynamicComponentBaseFor <TModel, TProperty> dynamicComponentBase)
            : base("input", dynamicComponentBase)
        {
            /* Adicionar os atributos de acordo com o que for obtido no Metadata... */
            //TagElement.AddInputTypeAttribute(fieldType);
            TagElement.AddInputAttributeIsNotNull("type", "range");
            TagElement.AddInputAttributeIsNotNull("min", this.ComponentBase.MetadataAttributes.GetValue <double>("Progress", "MinValue"));
            TagElement.AddInputAttributeIsNotNull("max", this.ComponentBase.MetadataAttributes.GetValue <double>("Progress", "MaxValue"));
            TagElement.AddInputAttributeIsNotNull("step", this.ComponentBase.MetadataAttributes.GetValue <double>("Progress", "Step"));

            /* Adicionar os atributos de acordo com o que for obtido no HtmlAttributes... */
            TagElement.MergeInputAttributeHtmlAttributes("class", this.ComponentBase.HtmlAttributes);
            TagElement.MergeInputAttributeHtmlAttributes("style", this.ComponentBase.HtmlAttributes);

            /* Injetando o Valor no Input... */
            this.Value = this.ComponentBase.FieldValue;
            TagElement.AddInputAttributeIsNotNull("value", this.Value);
        }