Copied to clipboard

Flag this post as spam?

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


  • Aileen 59 posts 79 karma points
    Jun 10, 2010 @ 15:03
    Aileen
    0

    Custom Section - Delete Functionality in Tree

    I've added my own custom section to Umbraco and have added the Delete functionality to the tree. This all works fine, but once I have deleted the item from the tree, I want the iframe on the right to reload so that the deleted item is no longer shown. I thought that I could use returnUrl for this but for some reason it's not working. Any help would be really appreciated!

    Here's a copy of my code:

        public class FormBuilderTasks : umbraco.interfaces.ITaskReturnUrl
        {
            private string _alias;
            private int _parentID;
            private int _typeID;
            private int _userID;
           
            public int UserId
            {
                set { _userID = value; }
            }

            public int TypeID
            {
                set { _typeID = value; }
                get { return _typeID; }
            }

            public int ParentID
            {
                set { _parentID = value; }
                get { return _parentID; }
            }

            public string Alias
            {
                get { return _alias; }
                set { _alias = value; }
            }

            #region ITaskReturnUrl Members

            private string _returnUrl = "";

            public string ReturnUrl
            {
                get { return _returnUrl; }
            }

            #endregion

           
            /// <summary>
            /// Create a new form
            /// </summary>
            public bool Save()
            {
                return true;
            }

            /// <summary>
            /// Delete a form
            /// </summary>
            public bool Delete()
            {
                string filePath = HttpContext.Current.Server.MapPath("/umbraco/formBuilder/forms/" + ParentID + ".xml");

                try
                {
                    File.Delete(filePath);
                    _returnUrl = "/umbraco/formBuilder/AdminContainer.aspx";
                    return true;
                }
                catch
                {
                    return false;
                }
        }

  • Steen Tøttrup 191 posts 291 karma points c-trib
    Jun 10, 2010 @ 17:34
    Steen Tøttrup
    0

    Isn't the node removed when you return true from the Delete method (with javascript)?

    That's how I remember my application working...

  • Aileen 59 posts 79 karma points
    Jun 14, 2010 @ 18:36
    Aileen
    0

    Hi Steen

    My node is removed from my tree, but I need the iframe (on the right) containing the details of my node to reload so that the content related to my deleted node is no longer displayed.

  • chappers 18 posts 36 karma points
    Oct 06, 2010 @ 18:39
    chappers
    0

    Hi Aileen,

    Did you ever get a solution to this?  I'm in exactly the same boat! 

    Many Thanks

    Chris

     

     

Please Sign in or register to post replies

Write your reply to:

Draft