Added NumericFieldBinding.

This commit is contained in:
Sipke Schoorstra
2015-05-06 21:38:41 +02:00
parent 02b889a925
commit fa3f1cbc70
2 changed files with 14 additions and 0 deletions
@@ -0,0 +1,13 @@
using Orchard.ContentManagement;
using Orchard.DynamicForms.Services;
using Orchard.DynamicForms.Services.Models;
using Orchard.Fields.Fields;
namespace Orchard.DynamicForms.Bindings {
public class NumericFieldBindings : Component, IBindingProvider {
public void Describe(BindingDescribeContext context) {
context.For<NumericField>()
.Binding("Value", (contentItem, field, s) => field.Value = XmlHelper.Parse<decimal>(s));
}
}
}
@@ -166,6 +166,7 @@
<Compile Include="Bindings\EnumerationFieldBindings.cs" />
<Compile Include="Bindings\InputFieldBindings.cs" />
<Compile Include="Bindings\TaxonomyFieldBindings.cs" />
<Compile Include="Bindings\NumericFieldBindings.cs" />
<Compile Include="Forms\AddModelErrorForm.cs" />
<Compile Include="Forms\SelectDynamicForms.cs" />
<Compile Include="Bindings\TextFieldBindings.cs" />