PartialRefreshLinks

Links in Partial Refresh enabled Portlets

It seems that when you enable partial refresh in portlets, the normal anchor links do not work anymore. This is due to the fact that since all links and submits pass through the partial refresh logic present in dyna.js found under jboss-portal.sar\portal-ajax.war\dyna. Here below you can find a simple trick to avoid certain links that you do not want them to pass through ajaxified partial refresh submits, but rather behave like normal links or submits.

 

  • Modify the dyna.js for this function as

function isURLAccepted(url) {
  if (url.indexOf("http://") == 0)
  {
     if (url.indexOf("noajax") >= 0)
     {
        return false;
     }
     else
     {
        var indexOfSlash = url.indexOf("/", "http://".length);
        if (indexOfSlash < 0)
        {
           return false;
        }
        else if (indexOfSlash > 0)
        {
           var path = url.substring(indexOfSlash);
           if (path.indexOf(server_base_url) != 0)
           {
              return false;
           }
        }
     }
  }
  else if (url.indexOf(server_base_url) != 0)
  {
     return false;
  }
  return true;

}

 

  • In all urls either in submit action or the Anchor's href just suffix the "noajax" keyword and now the links should bypass ajax request.

 

Referenced by: