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

  • Tim Geyssens 6562 posts 15373 karma points MVP 2x c-trib
    Oct 01, 2013 @ 15:54
    Tim Geyssens
    0

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

  • Tim Geyssens 6562 posts 15373 karma points MVP 2x c-trib
    Oct 01, 2013 @ 16:50
    Tim Geyssens
    0

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

  • Tim Geyssens 6562 posts 15373 karma points MVP 2x c-trib
    Oct 01, 2013 @ 16:59
    Tim Geyssens
    0

    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!

     

  • Tim Geyssens 6562 posts 15373 karma points MVP 2x c-trib
    Oct 02, 2013 @ 10:09
    Tim Geyssens
    0

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

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies