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:
I've noticed that this js error is being throw in the chatterDefer.js
has someone loaded the chatter component on demand ?