|
|
|
@ -38,7 +38,9 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Form |
|
|
|
|
|
|
|
public override async Task ProcessAsync(TagHelperContext context, TagHelperOutput output) |
|
|
|
{ |
|
|
|
var innerHtml = await GetFormInputGroupAsHtmlAsync(context, output); |
|
|
|
var childContent = await output.GetChildContentAsync(); |
|
|
|
|
|
|
|
var innerHtml = await GetFormInputGroupAsHtmlAsync(context, output, childContent); |
|
|
|
|
|
|
|
var order = TagHelper.AspFor.ModelExplorer.GetDisplayOrder(); |
|
|
|
|
|
|
|
@ -58,9 +60,9 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Form |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
protected virtual async Task<string> GetFormInputGroupAsHtmlAsync(TagHelperContext context, TagHelperOutput output) |
|
|
|
protected virtual async Task<string> GetFormInputGroupAsHtmlAsync(TagHelperContext context, TagHelperOutput output, TagHelperContent childContent) |
|
|
|
{ |
|
|
|
var selectTag = await GetSelectTagAsync(context, output); |
|
|
|
var selectTag = await GetSelectTagAsync(context, output, childContent); |
|
|
|
var selectAsHtml = selectTag.Render(_encoder); |
|
|
|
var label = await GetLabelAsHtmlAsync(context, output, selectTag); |
|
|
|
var validation = await GetValidationAsHtmlAsync(context, output, selectTag); |
|
|
|
@ -74,7 +76,7 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Form |
|
|
|
return "<div class=\"form-group\">" + Environment.NewLine + innerHtml + Environment.NewLine + "</div>"; |
|
|
|
} |
|
|
|
|
|
|
|
protected virtual async Task<TagHelperOutput> GetSelectTagAsync(TagHelperContext context, TagHelperOutput output) |
|
|
|
protected virtual async Task<TagHelperOutput> GetSelectTagAsync(TagHelperContext context, TagHelperOutput output, TagHelperContent childContent) |
|
|
|
{ |
|
|
|
var selectTagHelper = new SelectTagHelper(_generator) |
|
|
|
{ |
|
|
|
@ -97,7 +99,7 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Form |
|
|
|
|
|
|
|
var selectTagHelperOutput = await selectTagHelper.ProcessAndGetOutputAsync(GetInputAttributes(context, output), context, "select", TagMode.StartTagAndEndTag); |
|
|
|
|
|
|
|
selectTagHelperOutput.Content.SetHtmlContent(await output.GetChildContentAsync()); |
|
|
|
selectTagHelperOutput.Content.SetHtmlContent(childContent); |
|
|
|
selectTagHelperOutput.Attributes.AddClass("form-control"); |
|
|
|
selectTagHelperOutput.Attributes.AddClass(GetSize(context, output)); |
|
|
|
AddDisabledAttribute(selectTagHelperOutput); |
|
|
|
|