Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Mark 49 posts 130 karma points
    Mar 11, 2013 @ 19:50
    Mark
    0

    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

    httpContext.Request[this.AssociatedField.Id.ToString()]

    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.

     

  • Fabio Milheiro 74 posts 136 karma points
    Oct 01, 2013 @ 14:35
    Fabio Milheiro
    0

    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

    Oct 01, 2013 @ 15:54

    Will look into it for next maintenance release, more details this week but sounds like this is a bug

  • Comment author was deleted

    Oct 01, 2013 @ 16:50

    Yup definitely a bug, can reproduce, looking into fix now

  • Comment author was deleted

    Oct 01, 2013 @ 16:59

    Ok think I found a fix, can you try this build: http://nightly.umbraco.org/Umbraco%20Contour/3.0.17%20WIP/

  • Fabio Milheiro 74 posts 136 karma points
    Oct 01, 2013 @ 23:17
    Fabio Milheiro
    0

    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

    Oct 02, 2013 @ 10:09

    Yup with the fix it will also be populated on Validate :)

Please Sign in or register to post replies

Write your reply to:

Draft