I'm trying to build a custom DropDownList with custom values using a third party service.
I'm stuck with two options.
#1 - New FieldType
public class CustomField: Umbraco.Forms.Core.FieldType
{
public CustomField()
{
this.DataType = FieldDataType.[String|LongString|Integer|DateTime|Bit];
}
}
Issues
How can I specify that my CustomField will be a DropDownList?
#2 - New FieldPreValueSourceType
public override List<PreValue> GetPreValues(Field field, Form form)
{
List<PreValue> result = new List<PreValue>();
...
return result;
}
Issues
How can I set the default value? Not static, but dynamic.
Umbraco Forms - Custom Fields
Hi guys,
I'm trying to build a custom DropDownList with custom values using a third party service.
I'm stuck with two options.
#1 - New FieldType
Issues
#2 - New FieldPreValueSourceType
Issues
Any tip on this?
Cheers,
/Pedro
I figured out that adding this line
into a FieldType constructor enables a DropDownList.
Now I can set the selected value inside the view.
/Pedro
is working on a reply...