Skip to content
This repository has been archived by the owner on Jan 11, 2018. It is now read-only.

Commit

Permalink
Merge pull request #64 from dbuenor/dbueno/support-for-inputfor-insid…
Browse files Browse the repository at this point in the history
…e-inputgroup

Added Support for InputFor inside a InputGroup
  • Loading branch information
daveaglick committed Sep 16, 2016
2 parents 4020b7b + ba248e8 commit 92d8625
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions FluentBootstrap.Mvc/Forms/MvcFormExtensions.cs
Expand Up @@ -246,6 +246,15 @@ public static ValidationSummary<TModel> IncludePropertyErrors<TModel>(this Valid
return builder;
}

public static ComponentBuilder<MvcBootstrapConfig<TModel>, Input> InputFor<TModel, TValue>(
this ComponentWrapper<MvcBootstrapConfig<TModel>, InputGroup> wrapper, Expression<Func<TModel, TValue>> expression, FormInputType inputType = FormInputType.Text)
{
ModelMetadata metadata = ModelMetadata.FromLambdaExpression(expression, wrapper.GetConfig().HtmlHelper.ViewData);
string expressionText = ExpressionHelper.GetExpressionText(expression);
string name = GetControlName(wrapper, expressionText);
return wrapper.Input(name, metadata.Model, metadata.EditFormatString, inputType);
}

public static ComponentBuilder<MvcBootstrapConfig<TModel>, Input> InputFor<TComponent, TModel, TValue>(
this BootstrapHelper<MvcBootstrapConfig<TModel>, TComponent> helper, Expression<Func<TModel, TValue>> expression, FormInputType inputType = FormInputType.Text)
where TComponent : Component, ICanCreate<Input>
Expand Down

0 comments on commit 92d8625

Please sign in to comment.