Copied to clipboard

Flag this post as spam?

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


  • Tom Holland 283 posts 40 karma points
    Jul 31, 2009 @ 17:02
    Tom Holland
    0

    Event handler & speechbubble message

    I'm making an event handler which will POST to twitter when an article is published in umbraco. I would like to cancel the publish and notifiy the user if the tweet text is too long, I don't see how to set the speechbubble message.

    After the event handler cancels, the speech bubble reads "Publishing cancelled by a third party add-in". How can I change that message?

    This is what I tried:

    void Document_BeforePublish(Document sender, umbraco.cms.businesslogic.PublishEventArgs e)
    {
    ...snippet...

    e.Cancel = true;
    ((umbraco.BasePages.BasePage)sender.HttpContext.CurrentHandler).speechBubble(umbraco.BasePages.BasePage.speechBubbleIcon.error,"Error publishing","The Twitter post will be too long: " + tooLong.ToString() + "chars");

    ...snippet...

    }

     

  • Peter Dijksterhuis 1442 posts 1722 karma points
    Jul 31, 2009 @ 17:10
    Peter Dijksterhuis
    0

    I think I heard somewhere that that is currently not possible. I tried to use that in my own datatype as well, but never got it working.

    I ended up showing the red div at the top (which also shows when you haven't filled a mandatory field).

  • Tom Holland 283 posts 40 karma points
    Jul 31, 2009 @ 17:30
    Tom Holland
    0

    Do you have an example of how you set that div contents - did you do it directly in the handler or did you need client script?

  • Niels Hartvig 1951 posts 2391 karma points c-trib
    Jul 31, 2009 @ 17:42
    Niels Hartvig
    1

    This is not possible as the speechbubble doesn't allow chaining in the current implementation, so the only way to get around that would be a hack where you added the speechbubble with a 30 second timeout (to be shown after the other message) which is not elegant.

    We're considering adding speechbubble chaining (growl style) for 4.1 but I think it might be a little too geeky and I prefer the possibility of adding a cancellation message instead.

  • Peter Dijksterhuis 1442 posts 1722 karma points
    Jul 31, 2009 @ 17:48
    Peter Dijksterhuis
    0

    I don't think my solution will work on an EventHandler. My datatype adds a CustomValidator to the page. You can't do that with an EventHandler.

  • Tom Holland 283 posts 40 karma points
    Jul 31, 2009 @ 17:53
    Tom Holland
    0

    Well, I guess I'll add a nicer message then in 4.1. Thanks for the info.

  • Aaron Powell 1708 posts 3046 karma points c-trib
    Aug 01, 2009 @ 02:59
    Aaron Powell
    1

    @Niels - I believe Shannon is still planning on including that, based on the implementation he blogged about here: http://farmcode.org/post/2009/04/06/jQuery-popup-bubble-extension.aspx

    I've also considered adding a cancel message property to the event args which allows you to provide better feedback, but I've not had time of recent.

Please Sign in or register to post replies

Write your reply to:

Draft