4

Question

How can I load chatter (chatter:feedWithFollowers) dynamically (using javascript) in the browser?

Motivation

I'm working on a Visualforce page that should load as fast as possible and the user should be able to open chatter feed when they click on a link.

The page controller and Vf components should be optimized in order to perform fast enough.

However, when I check network traffic in the browser I can see that Salesforce is including TONS of static resources (js, img and css libraries) in order to include chatter and this is taking its toll on the page loading performance.

So far

I've tried to load it by doing something like this:

<a href="#" onClick="toogleChatter();" >Chatter</a>
<apex:actionFunction name="toogleChatter" action="{!toogleChatter}" rerender="chatter" />
<apex:outputPanel id="chatter" >
    <chatter:feedWithFollowers entityId="{!obj.id}" showHeader="true" rendered="{!chatterOn}"/>  
</apex:outputPanel>

When chatter loads it has some initialization issue and is not starting well:

enter image description here

I've noticed that this js error is being throw in the chatterDefer.js

chatterDefer.js Error

has someone loaded the chatter component on demand ?

  • Have you looked at ngForce - github.com/noeticpenguin/ngForce the library built by Kevin Poorman. It does away with the heavy duty stuff and lets you call the Chatter API without burning API calls or resources. – Gaurav Kheterpal Sep 4 '14 at 11:23
  • Cool library, but I don't want to create the entire chatter functionality in JS, I think that it doesn't allow me to load the standard chatter feed, does it ? – Martin Borthiry Sep 4 '14 at 11:32
  • if you figured anything out, would love to hear it. running into this same issue myself. – gorav Jan 17 '17 at 17:31

Your Answer

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

Browse other questions tagged or ask your own question.