in my application I created a Javascript(posted below) to show and hide chatter feeds in the home page which was working fine till winter release.But post Spring '13 release the chatter toggle chatter.getFeed().toggle() is not working properly.The method is calling two parameters chatter.getFeed().toggle(param1, param2)!! No idea whats param 1 and param 2....and what should i pass to fix it.Anybody got any ideas what are the parameters??


<iframe id="wayhomeFrame" height="700" src="/apex/Unilever_Way_Home" frameborder="0" width="100%"></iframe>
var p2 = document.getElementById("wayhomeFrame").parentNode.previousSibling;
</script> &nbsp; 
var thehideLink = document.getElementById("hideFeedLink");
var attributeStyle=thehideLink.hasAttribute("style");
  var newItem=document.createElement("script");
  newItem.innerHTML = "chatter.getFeed().toggle('',true);";
var ScriptDiv = document.getElementById("hideFeedLink");
var style = ScriptDiv.getAttribute("style");
if(style == null){
  var sHTML = ScriptDiv.innerHTML;
  var sScript="<script DEFER>";
  sScript = sScript + "chatter.getFeed().toggle('',true); ";
  sScript = sScript + "</script" + ">";
  ScriptDiv.innerHTML = sHTML + sScript;

It does look like the chatter.getFeed().toggle() processing has changed to use an object parameter and a boolean parameter; however, this is 100% acceptable because that JavaScript is NOT a published Salesforce API and should not be used at all.

Take a look at the first 4 lines of the Chatter.js file:

 * This code is for Internal Salesforce use only, and subject to change without notice.
 * Customers shouldn't reference this file in any web pages.

If you have a Visualforce page and you need to replicate that toggle behavior you could look at something like jQuery that has a toggle function or click function. You still might have maintainability issues if your selectors rely on internal SF code, though.

Another possibility would be to look at how the internal Salesforce JavaScript implementation of toggling of the element is done, and try to copy, paste, and modify it in a way that doesn't rely on any internal SF JavaScript or APIs.

Try to avoid any solution that relies on the internal Salesforce JavaScript.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.