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");
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.
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;
}
}
Isn't the node removed when you return true from the Delete method (with javascript)?
That's how I remember my application working...
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.
Hi Aileen,
Did you ever get a solution to this? I'm in exactly the same boat!
Many Thanks
Chris
is working on a reply...