Radio button tag helper refactor

pull/301/head
yekalkan 7 years ago
parent b81a896189
commit 750c21c3ac

@ -150,16 +150,12 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Form
protected virtual AbpTagHelper GetSelectGroupTagHelper(TagHelperContext context, TagHelperOutput output, ModelExpression model)
{
if (IsRadioGroup(model.ModelExplorer))
{
var abpRadioInputTagHelper = _serviceProvider.GetRequiredService<AbpRadioInputTagHelper>();
abpRadioInputTagHelper.AspFor = model;
abpRadioInputTagHelper.AspItems = null;
abpRadioInputTagHelper.Inline = GetAttribute<AbpRadioButton>(model.ModelExplorer).Inline;
abpRadioInputTagHelper.ViewContext = TagHelper.ViewContext;
return abpRadioInputTagHelper;
return IsRadioGroup(model.ModelExplorer) ?
GetAbpRadioInputTagHelper(model) :
GetSelectGroupTagHelper(model);
}
else
private AbpTagHelper GetSelectGroupTagHelper(ModelExpression model)
{
var abpSelectTagHelper = _serviceProvider.GetRequiredService<AbpSelectTagHelper>();
abpSelectTagHelper.AspFor = model;
@ -167,6 +163,15 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Form
abpSelectTagHelper.ViewContext = TagHelper.ViewContext;
return abpSelectTagHelper;
}
private AbpTagHelper GetAbpRadioInputTagHelper(ModelExpression model)
{
var abpRadioInputTagHelper = _serviceProvider.GetRequiredService<AbpRadioInputTagHelper>();
abpRadioInputTagHelper.AspFor = model;
abpRadioInputTagHelper.AspItems = null;
abpRadioInputTagHelper.Inline = GetAttribute<AbpRadioButton>(model.ModelExplorer).Inline;
abpRadioInputTagHelper.ViewContext = TagHelper.ViewContext;
return abpRadioInputTagHelper;
}
protected virtual string ProcessSubmitButtonAndGetContent(TagHelperContext context, TagHelperOutput output)

Loading…
Cancel
Save