Copied to clipboard

Flag this post as spam?

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


  • Deci 19 posts 48 karma points
    Jul 10, 2013 @ 18:20
    Deci
    0

    Field Lengths

    Hi all, 

    I was playing around with the Document.BeforeSave event and I can hook it fine and it does everything I want to, even updating the chat bubble which is cool (it's the only event I have tried so far that updating the bubble works).

    The problem is I am using 4.71 and in the BeforeSave event, the getProperty() of the document all have the old pre-changed values so I have no idea what the user is trying to save. I read somewhere that 4.1 had this fixed but it really doesn't seem to be the case for me.

    Of course, AfterSave does have the new values but it's pointless at this stage as it's already saved (plus the bubble doesn't work so I can't even tell the user something was wrong and they think everything's cool).

    Rolling back here is an option but it seems a horrible hack when the BeforeSave really should be presenting me with the new data.

    What am I missing unless it's an "upgrade required" fix...which I'm not too keen on.

    thanks
    Deci

  • Jan Skovgaard 11280 posts 23678 karma points MVP 10x admin c-trib
    Jul 11, 2013 @ 00:20
    Jan Skovgaard
    0

    Hi Deci

    Have you had a look at the uComponents project? It provides a datatype where you can define a field length on the datatype and choose wether it should be used as a textstring or a multiple textbox.

    You can create as many datatypes based on the uComponents datatype as you need. The benefit is that you can save some work figuring out the different ways of interacting with the API hooking into events.

    The datatype is called "Character limit" and you can see more details about it here http://ucomponents.org/data-types/character-limit/

    Be aware though that the current version is 5.4.2 and it will only work with v4.8+ - But the good thing is that this datatype does also exist in version 4.x of the project - You can download it from here http://our.umbraco.org/projects/backoffice-extensions/ucomponents

    Hope this helps.

    /Jan

Please Sign in or register to post replies

Write your reply to:

Draft