How to refresh content tree in backoffice using code from server
Hello,
I have implemented a feature that copies nodes from a location to another.
If the destination already has the nodes I have to delete them and then create the new ones. This part is working, but the nodes in the content tree are not updating, so when the user tries to see the new nodes he's presented with an error message saying "Request error: The URL returned a 404 (not found):
/umbraco/backoffice/UmbracoApi/Content/GetById". The user has to "Reload" the nodes manually.
I'm implementing this feature using the event ContentService.Saved (ApplicationEventHandler)
I've tried to use the following functions but without luck.
new Umbraco.Web.UI.Pages.ClientTools(new Umbraco.Web.UI.Pages.UmbracoEnsuredPage()).SyncTree(parentContent.Path, true).RefreshTree();
thank you for your answer. I won't mark your reply as a solution because I wanted to refresh the content tree from the server side and I thought I could achieve this by using one of this functions:
new Umbraco.Web.UI.Pages.ClientTools(new Umbraco.Web.UI.Pages.UmbracoEnsuredPage()).SyncTree(parentContent.Path, true).RefreshTree();
How to refresh content tree in backoffice using code from server
Hello,
I have implemented a feature that copies nodes from a location to another. If the destination already has the nodes I have to delete them and then create the new ones. This part is working, but the nodes in the content tree are not updating, so when the user tries to see the new nodes he's presented with an error message saying "Request error: The URL returned a 404 (not found): /umbraco/backoffice/UmbracoApi/Content/GetById". The user has to "Reload" the nodes manually.
I'm implementing this feature using the event ContentService.Saved (ApplicationEventHandler)
I've tried to use the following functions but without luck.
Another away
The content tree does not show the new content. What I'm doing wrong?
Hi Pedro
Can you show the code that moves nodes?
Thanks,
Alex
Hi Alex
The code is something like this:
The code is for copying not moving and I try to match the properties of each node because the document types are not the same.
Any clue?!
Any tips?
Hi Pedro
you need to call angular method that will refresh the tree after server side changes
Hi Alex,
how can I do that? Can you provide me more details please?
Hi Pedro
In Angular, you need to use the navigation service and call the sync tree method.
Read more at http://umbraco.github.io/Belle/#/api/umbraco.services.navigationService
Thanks
Hi David,
thank you for your answer. I won't mark your reply as a solution because I wanted to refresh the content tree from the server side and I thought I could achieve this by using one of this functions:
or
Thanks
is working on a reply...