I am working on custom fieldtype based on fileupload but i want to be able to set allowed extensions. So I have created new custom field code is ripped form contour shared source for uploadfield type however in mine as per the documentation page 9 I have added a setting e.g.
[Umbraco.Forms.Core.Attributes.Setting("Upload extensions",
description = "Allowed file extensions",
control = "Umbraco.Forms.Core.FieldSetting.TextField")]
public string AllowedExtensions { get; set; }
In contour when i add this type i should see setting Allowed file extensions are am i missing a trick? The second question is in the fieldtype how do i do the validation and throw up error message? In the documentation it mentions on page 9 overriding ValidateSettings property and doing test there however when you try this you get error saying no property to override not sure if this is specific only to workflow.
Thanks for you reply, gutted about not being able to have additional settings will this be available in future release. Anyhow I have come up with a work around for this see here
It is something we have on the todo for the next major version, there are however some technical challenges we need to overcome before it will be possible, but the initial tests look promising.
Setting not appearing
Guys,
I am working on custom fieldtype based on fileupload but i want to be able to set allowed extensions. So I have created new custom field code is ripped form contour shared source for uploadfield type however in mine as per the documentation page 9 I have added a setting e.g.
In contour when i add this type i should see setting Allowed file extensions are am i missing a trick? The second question is in the fieldtype how do i do the validation and throw up error message? In the documentation it mentions on page 9 overriding ValidateSettings property and doing test there however when you try this you get error saying no property to override not sure if this is specific only to workflow.
Regards
Ismail
Comment author was deleted
Hi Ismail,
Currently you can't add additional settings to a field type.
For the validation you simply need to add the ValidationProperty attribute to your custom webcontrol.
Cheers,
Tim
Tim,
Thanks for you reply, gutted about not being able to have additional settings will this be available in future release. Anyhow I have come up with a work around for this see here
Regards
Ismail
Hi Ismail
It is something we have on the todo for the next major version, there are however some technical challenges we need to overcome before it will be possible, but the initial tests look promising.
/per
Per,
Awesome looking forward to it, its a great product I have been having some fun extending it.
Regards
Ismail
is working on a reply...