However when I attempt to do this in Validate the AssociatedField object is null... any ideas on how to gain a reference to the current field value in Validate so we can perform custom validation for a field?
Unrelated note - would recommend moving Model.Indicator to FieldViewModel - since it already contains 'ShowIndicator' and other similar fields it makes sence, making it simple to move the label into the fields rather then the form, allowing them to be easily overridable so multiple fields can have the same label or no label.
I think I'll be too busy in the next few days to test your solution, but, just be clear, I found out that the AssociatedField property was null on Validate overridden method and it was NOT null in the ProcessValue method.
overriding ProcessValue & Validate for current field value in mvc forms
so it seems that the way to refer to a custom field value in ProcessValue is via something like
However when I attempt to do this in Validate the AssociatedField object is null... any ideas on how to gain a reference to the current field value in Validate so we can perform custom validation for a field?
Unrelated note - would recommend moving Model.Indicator to FieldViewModel - since it already contains 'ShowIndicator' and other similar fields it makes sence, making it simple to move the label into the fields rather then the form, allowing them to be easily overridable so multiple fields can have the same label or no label.
Hi Mark,
Did you find a solution for this? I am running into the same issue and I can't find more information on it.
Thanks,
Fabio
Comment author was deleted
Will look into it for next maintenance release, more details this week but sounds like this is a bug
Comment author was deleted
Yup definitely a bug, can reproduce, looking into fix now
Comment author was deleted
Ok think I found a fix, can you try this build: http://nightly.umbraco.org/Umbraco%20Contour/3.0.17%20WIP/
I think I'll be too busy in the next few days to test your solution, but, just be clear, I found out that the AssociatedField property was null on Validate overridden method and it was NOT null in the ProcessValue method.
It's great to have such quick support though!
Comment author was deleted
Yup with the fix it will also be populated on Validate :)
is working on a reply...