cancel
Showing results for 
Search instead for 
Did you mean: 

Alfresco YUI Refresh Page.

rutaveejshah
Champ in-the-making
Champ in-the-making
Hello Everyone!

I have made a webscript for moving a docuemnt from userhome folder to another folder.When i click on button and ajax call the document is moved but change are  reflected  after manually reloading the page.
Any solution for this? i do not want to reload the page.

If any body have any idea than please reply as early as possible.

my code for yui lies here:


onUploadToKb:function DLTB_onFileUploadWithTooltip(e, p_obj)
      {
         var uniqueIdOfFolder=this.doclistMetadata.parent.nodeRef;
         Alfresco.util.PopupManager.displayMessage(
               {
                  text: "Show Document"+uniqueIdOfFolder
               });
            Alfresco.util.Ajax.request(
               {
            url:"http://127.0.0.1:8080/alfresco/service'+'/components/alfresco/uploadToKb?parentNode='+uniqueIdOfFold...,
              method: Alfresco.util.Ajax.GET,
                  successCallback:
                  {
                fn :this.onTemplateLoaded,
                obj: this,
                scope:this
                   
                  },
              scope: this,
                  execScripts: true,
              failureMessage: "Could not Upload the Document"
               });
      },
      
      onTemplateLoaded : function()
      {
      Alfresco.util.PopupManager.displayMessage(
               {
                  text: "Document is Moved Successfully"
               });
      },

2 REPLIES 2

yogeshpj
Star Contributor
Star Contributor
Hi,

Anyhow you have to refresh the page because the response of the repository websscript need to be updated once your file has been moved to other folder.
Try to recall only webscript which lists the contents rather than reloading whole page.

I know its a late reply but if it can help someone

replace the successcallback with

               success:
                {
                   event:
               {
                  name: "metadataRefresh"
               },
               callback:
               {
                  fn: function tt(response){
                     Alfresco.util.PopupManager.displayPrompt(
                     {
                        title: "Success Message",
                        text: response.serverResponse.responseText
                     });
                  },
                  scope: this
               }
            }