Copied to clipboard

Flag this post as spam?

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


  • yogiberr 8 posts 1 karma points
    Jul 01, 2009 @ 18:06
    yogiberr
    0

    Adding a "saved" notification to a .net user cntrol

    Hiya,

    I've created my first userCtrl that programatically creates a user :-)

    However, I notice that the "saved" notification doesn't appear in the bottom right hand side when I create and save the user:

                        u.addApplication("members");
                        u.Save();

    YET, when I do it thru the standard Umbraco UI, ie click the "save" icon, then the notification appears.

    Does nyone know why this would be? I go the code various articles, but I haven't managed to find the notification.

    Many thanks,

     

    yogi

     

  • Paul Sterling 716 posts 1512 karma points MVP 5x admin c-trib
    Jul 01, 2009 @ 18:49
    Paul Sterling
    0

    Yogi -

    It's difficult to tell your approach from the bit of code you provided, but the umbraco approach to this is via 'tasks.'  You'd implement:

     

    umbraco.interfaces.ITaskReturnUrl

    and then set your return value to True for the Save() Event - here's an example from Commerce for Umbraco:

            public bool Save()
            {
                Category thisCat = new Category();
                thisCat.CategoryName = _alias;
                thisCat.Save();
                int id = thisCat.CategoryID;
                m_returnUrl = string.Format("commerce/editCategory.aspx?c={0}", id);
                return true;
            }<span style="color: #2b91af; font-size: x-small;"></span>

    If this isn't helping. I'd recommend grabbing the source from the Commerce for Umbrao project (http://commerce4umbraco.codeplex.com/SourceControl/ListDownloadableCommits.aspx) and peeking in the .adminSection VS project for some hints on one approach.

    -Paul

  • Paul Sterling 716 posts 1512 karma points MVP 5x admin c-trib
    Jul 01, 2009 @ 18:54
    Paul Sterling
    0

    Wow - the formatting in this RTE is always a surprise - second try:

    Implement:

         umbraco.interfaces.ITaskReturnUrl

    and the set your return to True for success:

            public bool Save()
            {
                Category thisCat = new Category();
                thisCat.CategoryName = _alias;
                thisCat.Save();
                int id = thisCat.CategoryID;
                m_returnUrl = string.Format("commerce/editCategory.aspx?c={0}", id);
                return true;
            }

    Commerce for Umbraco source:

    http://commerce4umbraco.codeplex.com/SourceControl/ListDownloadableCommits.aspx

    One last tip - the notifications are called 'Speech Bubbles' in Umbraco-speak.

    -Paul

  • Richard Soeteman 3875 posts 12037 karma points MVP
    Jul 01, 2009 @ 21:10
    Richard Soeteman
    3

    Hi Yogi,

    As Paul mentioned you can use the SpeechBbubble Method on the Basepage. I've wrote a blogpost with source about this a while back   http://www.richardsoeteman.net/PermaLink,guid,03a7169e-7710-4775-b9a4-435dc5c4da11.aspx

    Below the snippet to show the speechbubble

    if (Page is BasePage)  

    ((BasePage)Page).speechBubble(BasePage.speechBubbleIcon.info, "Header","Some more info"); 
    }

    Hope this helps you,

    Richard

  • Paul Sterling 716 posts 1512 karma points MVP 5x admin c-trib
    Jul 01, 2009 @ 22:17
    Paul Sterling
    0

    Nice solution Richard...a bit more direct than my suggestion - which really only applies to a new Admin Section and related tasks. 

    Thumbs up for you!

    -Paul

  • Aaron Powell 1708 posts 3044 karma points c-trib
    Jul 02, 2009 @ 00:36
    Aaron Powell
    0

    Just for peoples reference, v4.1 will change the best way to launch a speech bubble, the new ClientTools class (which is available off BasePage) has a SpeechBubble method to call

  • Richard Soeteman 3875 posts 12037 karma points MVP
    Jul 02, 2009 @ 09:19
    Richard Soeteman
    0

    @paul thanks,

    @slace So that will break in 4.1? Or is it duplicate? I will not be to happy to have two versions of my packages that use a speechbubble. Allthough I have to do that anyway for version 5.

     

  • Aaron Powell 1708 posts 3044 karma points c-trib
    Jul 02, 2009 @ 09:39
    Aaron Powell
    0

    @richard - no it wont break anything (we try not to break anything on version releases. Note I said try :P), it just obsoletes the old method. Shannon is just trying to consolidate all the client API calls into a single API as it's a lot easier to maintain. Currently there's a lot of different ways to interact with the admin client model, and it's hard to maintain.

  • yogiberr 8 posts 1 karma points
    Jul 03, 2009 @ 12:45
    yogiberr
    0

    hiya,

    Thanks for all the replies folks.It certainly doesn't hurt for me to get an idea of how it works in this version.

    yogi

  • 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