You need to sign in to do that
Don't have an account?

Window Reload from Chatter
Hi All,
I have created a Global Action and Published in the Chatter Layout. The Action Type of Global Action is Custom Visualforce. The VisualForce page consists of a button when clicked it perform an action to Post some text to the Chatter.
I can able to Post to the Chatter successfully but I have to reload the Window to see my Post. But the window should be automatically reloaded once the button is clicked to show the inserted Post.
Here is the Screenshot of the Chatter with Global Action which consists the VF Page:

Here is the VF Page:
Here is the Controller:
Thanks in Advance,
Mike J
I have created a Global Action and Published in the Chatter Layout. The Action Type of Global Action is Custom Visualforce. The VisualForce page consists of a button when clicked it perform an action to Post some text to the Chatter.
I can able to Post to the Chatter successfully but I have to reload the Window to see my Post. But the window should be automatically reloaded once the button is clicked to show the inserted Post.
Here is the Screenshot of the Chatter with Global Action which consists the VF Page:
Here is the VF Page:
<apex:page controller="PracticeClass" > <script> function refreshPage(){ window.location.reload(); } </script> <apex:form > <div align="center" style="margin:100px auto" > <apex:inputTextarea /> <apex:commandButton value="PostToChatter" action="{!PostToChatter}" onclick="refreshPage()" /> </div> </apex:form> </apex:page>
Here is the Controller:
public class PracticeClass { public void PostToChatter() { FeedItem post=new FeedItem(); post.Body= 'Your Feed is Posted 12345'; post.ParentId= '00528000001KZre'; insert post; } }
Thanks in Advance,
Mike J
Looks like you need to use Asynchronous JavaScript for whis work. But that is not possible when you use VF page on Page Layout.
You need to find another way to solve that task. For example create custom VF page on new window and use Chater API to load all posts, and go forward to rerender that aria.
Please mark that as best answer if that helped you.
Best regards
Andrew
Appreciate your response.
If its not so much to ask, can you share few references on using Chatter API to load posts in VF page.
Thanks in Advance,
Mike J
I found that the window.parent.location value is actually blank inside the iframe, so i had to rebuild the the url for the parent page, i did this by passing in the Id of the record (in my case a chatter group id) as a url parameter and used the following javascript:
I wanted to post this incase someone else ran into the same issue.