I already create custom section in backend of umbraco, everything work fine(add, update) except deleting node( right click on node and click delete). , I follow http://www.nibble.be/?p=71 to implement my custom section. I try to comment code in method ITask.Delete but error still happen. The error that I got is "Sys.Net.WebServiceFailedException: The server method ‘Delete’ failed with the following error: System.NullReferenceException– Object reference not set to an instance of an object" it show in javascript error in status bar of IE8 . Any solution to solve the problem ?.
I
suppose that the problem comes from the names of the nodeType, RootNode and his
child nodes must have the same name. Another solution maybe define 2 different nodeTypes
in UI.xml.
Custom Section with delete node
Hello Everyone,
I already create custom section in backend of umbraco, everything work fine(add, update) except deleting node( right click on node and click delete). , I follow http://www.nibble.be/?p=71 to implement my custom section. I try to comment code in method ITask.Delete but error still happen. The error that I got is "Sys.Net.WebServiceFailedException: The server method ‘Delete’ failed with the following error: System.NullReferenceException– Object reference not set to an instance of an object" it show in javascript error in status bar of IE8 . Any solution to solve the problem ?.
Umbraco V 4.0.2.1
.Net V 3.5
Window Xp IIS6
Here is source code on deleting:
bool ITask.Delete()
{
/*string id = helper.Request("id");
if (string.IsNullOrEmpty(id))
{
return false;
}*/
//this.m_parentID = Convert.ToInt32(id);
.m_parentID);
if (shopManagement == null
)
return false
;
shopManagement.Delete();
return true
;
Here is source code on render:
public override void Render(ref XmlTree tree)
{
List<ShopManagement> shopList = ShopManagement.GetAllShop();
if (shopList != null)
{
foreach (ShopManagement shopmgn in shopList)
{
XmlTreeNode node = XmlTreeNode.Create(this);
node.NodeID = shopmgn.Id.ToString();
node.Action =
string.Format("javascript:openShop({0});", shopmgn.Id.ToString());
node.Icon =
"folder.gif";
node.OpenIcon =
"folder_o.gif";
node.Text = shopmgn.Name;
//node.Source = this.GetTreeServiceUrl(node.NodeID);
tree.Add(node);
}
}
}
public override void RenderJS(ref StringBuilder Javascript)
{
Javascript.Append(
@"
function openShop(id) {
parent.right.document.location.href = 'apw/controls/shop/Shop.aspx?id=' + id;
}
"
);
}
Thanks in advance,
Ks
OK, I got it, this problem was solved
Please put the answer and I'll mark it as the answer for you
yes please provide us with the answer for future reference, nice last name btw :)
I suppose that the problem comes from the names of the nodeType, RootNode and his child nodes must have the same name. Another solution maybe define 2 different nodeTypes in UI.xml.
I am having the same problem - please elaborage - thanks in advance
is working on a reply...