Navigate from an ExplicitPanel back to an Administrative Panel

I have an explicit panel loaded from an administrative panel.  Wondering how, if I do some sort of AJAX save on my explicit panel I can go back to the previous panel and reload it.

Parents
  • To return to the previous panel, you can call 

    $.telligent.evolution.administration.close();

    This will return to the previous panel in the history.

    Before closing, the explicit panel can publish a message through the messaging JavaScript API Module which can be read and handled by the calling panel to reload its data.

  •   I"m trying to use that messaging API to send a message across which should refresh the pane., but doesn't seem to be firing...

    Here is what I have. and these are both loaded up on explicit panels that are loaded right after each other.

    #registerEndOfPageHtml (  )
        ## end of page HTML
        <script type="text/javascript">
            jQuery(document).ready(function(){
                
    			jQuery.telligent.evolution.messaging.subscribe('refresh.reactions', function(data){
                    jQuery.telligent.evolution.administration.refresh(); 
    			 
    			});           

     jQuery.telligent.evolution.post({
                    url:"$core_v2_widget.GetExecutedFileUrl('save-edits.vm')", 
                    data:
                    {
                        "id":$reaction.Id,
                        "reactiontypeid":"$reactionTypeId", 
                        "triggertypeid":"$triggerTypeId", 
                        "configuration":configuration, 
                        "rules":rules, 
                        "contentid":"$course.ContentId" 
                    },    
                    success:function(response){
                        var data = {};
                        jQuery.telligent.evolution.messaging.publish("refresh.reactions", data, { crossWindow: true }); 
                        jQuery.telligent.evolution.administration.close();
                    }
                }); 

Reply
  •   I"m trying to use that messaging API to send a message across which should refresh the pane., but doesn't seem to be firing...

    Here is what I have. and these are both loaded up on explicit panels that are loaded right after each other.

    #registerEndOfPageHtml (  )
        ## end of page HTML
        <script type="text/javascript">
            jQuery(document).ready(function(){
                
    			jQuery.telligent.evolution.messaging.subscribe('refresh.reactions', function(data){
                    jQuery.telligent.evolution.administration.refresh(); 
    			 
    			});           

     jQuery.telligent.evolution.post({
                    url:"$core_v2_widget.GetExecutedFileUrl('save-edits.vm')", 
                    data:
                    {
                        "id":$reaction.Id,
                        "reactiontypeid":"$reactionTypeId", 
                        "triggertypeid":"$triggerTypeId", 
                        "configuration":configuration, 
                        "rules":rules, 
                        "contentid":"$course.ContentId" 
                    },    
                    success:function(response){
                        var data = {};
                        jQuery.telligent.evolution.messaging.publish("refresh.reactions", data, { crossWindow: true }); 
                        jQuery.telligent.evolution.administration.close();
                    }
                }); 

Children
  • When subscribing to the message (if it is originating from a different panel potentially), in the options of the subscription (3rd parameter), specify:

    { excludeAutoNameSpaces: true }

    By default, subscriptions are scoped to individual panels. This will identify that the subscription is not limited to the current panel. Notice that when you exclude auto name spacing, it is important to unregister the subscription when the panel unloads:

    var subscription = $.telligent.evolution.messaging.subscribe('message_name', function(data) {
    	// do stuff
    }, { excludeAutoNameSpaces: true });
    			
    $.telligent.evolution.administration.on('panel.unloaded', function(){
    	$.telligent.evolution.messaging.unsubscribe(subscription);
    });