Another issue on Umbraco.Forms 4.14. I'm trying to add settings to a FieldType to allow form designers to control how data is processed.
I have a custom FieldType which has parameters:
public class MyField : FieldType
{
[Umbraco.Forms.Core.Attributes.Setting("MySetting",
view = "TextField")]
public string MySetting{ get; set; }
public MyField ()
{
Id = new Guid("2991EFCB-D6E6-4383-A627-D5A86F43C816");
Name = "My Field";
this.Description = "My Field";
}
}
When I save a record I cannot see the setting in the RecordEventArgs object:
protected override void ApplicationStarted(UmbracoApplicationBase umbracoApplication, ApplicationContext applicationContext)
{
RecordStorage.RecordInserting += RecordInserting;
base.ApplicationStarted(umbracoApplication, applicationContext);
}
private void RecordInserting(object sender, RecordEventArgs a)
{
var myFieldInfo =
from f in a.Record.RecordFields
let ft = f.Value.Field.FieldType as MyField
where ft != null
select new
{
f,
ft
};
foreach (var fieldInfo in myFieldInfo)
{
var mySetting == fieldInfo.ft.MySetting; // This is always null
}
}
Cannot see FieldType Settings on RecordEventArgs
Hi!
Another issue on Umbraco.Forms 4.14. I'm trying to add settings to a FieldType to allow form designers to control how data is processed.
I have a custom FieldType which has parameters:
When I save a record I cannot see the setting in the RecordEventArgs object:
Any ideas?
Tom
OK - I found it under: (RecordEventArgs a).Record.RecordFields[0].Value.Field.Settings[0]
This seems like it is still a bug though as the type conversion
let ft = f.Value.Field.FieldType as MyField
doesn't seem to work here.
is working on a reply...