Copied to clipboard

Flag this post as spam?

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


  • modist 9 posts 29 karma points
    Jan 25, 2014 @ 00:48
    modist
    0

    Refresh content-tree in backoffice using api

    Hi,

    I have codeblock - hooked up on the event "ContentService.Saved". In this code I delete all childnodes of the saved node.

    My problem is that this change to the content-tree is not reflected in the backoffice content-tree, forcing the user to do a manual 'Reload notes'.

    I have tried several methods without any luck - see below for examples

    Umbraco.Web.UI.Pages.BasePage bp = new BasePage();
    
    bp.ClientTools.ChildNodeCreated();
    bp.ClientTools.SyncTree(node.Path, true);
    bp.ClientTools.ClearClientTreeCache();
    

    Anybody with help or suggestions ?

    Kind regards Morten

  • Per Ploug 865 posts 3491 karma points MVP admin
    Jan 27, 2014 @ 14:45
    Per Ploug
    0

    Hi Morten

    That is currently not possible out the box, as the tree is rendered when requested, it doesnt keep track of what is going on the server in the meantime, for that you would need to send push notifications to the browser, which umbraco currently doesnt do.

    If its something you really need, I would recommend you look into the library "signalR" which can subscribe to your events on the serverside, then push messages to the browser where you could then handle these messages, making the tree refresh, but its a bit of work, and not somethign that is supported out of the box

    /Per

  • modist 9 posts 29 karma points
    Jan 27, 2014 @ 23:15
    modist
    0

    Hi Per,

    Thnx for looking in to this.

    I have worked with SignalR - it is quite fun to play with.

    I would have been really nice to be able force a reload of the tree - at this would enable us to implement a kind of workflow-engine: If you do this to a node -> move it to another folder etc.

    If the user needs to rightclick&reload it wont have the same effect.

    keep up the good work :-)

    Kind regards Morten

  • Dallas 133 posts 405 karma points
    Aug 15, 2015 @ 21:50
    Dallas
    0

    hi

    Is it still the case that the content tree can't be reloaded from the server - in the Save event for example?

    Dallas

Please Sign in or register to post replies

Write your reply to:

Draft