Probably a more API friendly way of doing things, which also works from ApplicationBase handlery things (I got this from the DateFolders package by kipusoep) is:
...no, it doesn't refresh; my deleted node still appears in the tree after the redirect / contentframeurl change.
And something to bear in mind is that the client tools redirect is just that; a client redirect, so if you do it from a usercontrol it will load the current node then redirect from the client. This is pretty ugly so I am sticking with the Response.Redirect for my purposes.
The RefreshTree() reloads the tree (it has an overload taking a string treeType so I suspect it generates the UmbClientMgr script exactly as in your solution).
Then the ChangeContentFrameUrl() loads the node on the right and syncs the tree to it.
It's not completely ideal, as in my solution, it means you get the current right hand frame loading due to the node deletion postback, then instantly loading again as the client scripts fire; however, it is the only way I have found so far of syncing the tree - if you know of a way of syncing the tree to a specific node, or in fact just the current right hand node without reloading that frame, that'd be amazing :o)
I mean, it must be possible, because something is doing it when you do a Response.Redirect from within the right hand frame.
Just as an addendum, I made the double load a bit less ugly by setting Visible to false in my usercontrol delete item handler; this means that only a blank page is displayed before the client location change, which is much less distracting and "flickery".
@Rob - Sorry for the late response... No, I didn't solve this yet. However, I do know when we click on the Save and Publish icon it has the desired effect we're all looking for... kinda drives me crazy.
How to reload the Content Tree and Reload Right IFRAME
UMB 4.5.2
I programatically made changes to a couple of custom properties, published them, and now I'd like to refresh the backend UI to reflect those changes.
So how would you...
1) refresh the Content Tree in the Content Section?
2) reload the Right Iframe section to the node/doc of choice?
Hi Kevon, I am looking for a way to refresh the content tree myself, after deleting a node, did you manage to solve that one?
For reloading the right frame, from server side code, what I have done in a UserControl custom datatype is simply:
Probably a more API friendly way of doing things, which also works from ApplicationBase handlery things (I got this from the DateFolders package by kipusoep) is:
umbraco.BasePages.BasePage.Current.ClientTools .ChangeContentFrameUrl(string.Concat("editContent.aspx?id=", iMyNodeID));
That will also sync the content tree to that node, although I don't know off the top of my head if it refreshes it as well.
...no, it doesn't refresh; my deleted node still appears in the tree after the redirect / contentframeurl change.
And something to bear in mind is that the client tools redirect is just that; a client redirect, so if you do it from a usercontrol it will load the current node then redirect from the client. This is pretty ugly so I am sticking with the Response.Redirect for my purposes.
Hi Rob
Is the following snippet any use ?
That should refresh the whole tree - see this post.
HTH,
Hendy
Hi Hendy, I think I found the server side utility to link to that as you were posting that actually :o)
I am currently doing this after my node change:
umbraco.BasePages.BasePage.Current.ClientTools.RefreshTree(); umbraco.BasePages.BasePage.Current.ClientTools .ChangeContentFrameUrl(String.Concat("editContent.aspx?id=", DiaryRootID));
The RefreshTree() reloads the tree (it has an overload taking a string treeType so I suspect it generates the UmbClientMgr script exactly as in your solution).
Then the ChangeContentFrameUrl() loads the node on the right and syncs the tree to it.
It's not completely ideal, as in my solution, it means you get the current right hand frame loading due to the node deletion postback, then instantly loading again as the client scripts fire; however, it is the only way I have found so far of syncing the tree - if you know of a way of syncing the tree to a specific node, or in fact just the current right hand node without reloading that frame, that'd be amazing :o)
I mean, it must be possible, because something is doing it when you do a Response.Redirect from within the right hand frame.
Just as an addendum, I made the double load a bit less ugly by setting Visible to false in my usercontrol delete item handler; this means that only a blank page is displayed before the client location change, which is much less distracting and "flickery".
@Rob - Sorry for the late response... No, I didn't solve this yet. However, I do know when we click on the Save and Publish icon it has the desired effect we're all looking for... kinda drives me crazy.
is working on a reply...