Forum Discussion

vishwajeet_hol's avatar
11 years ago

get latest posts without refreshing the page.

Hi,

 

Please go through the following scenario :

Suppose, users A,B, and C are logged in to community. They are on same page.(let us assume, they are on ForumTopicPage). Now,user A and B posted something on that page. At that time, user C will not be able to see their posts until he refresh that page. 

My requirement is, user C should be able to see posts of user A and B without refreshing the page.

I think, we have to use Ajax call.

Is there any OOB functionality to achieve this.

Need your suggetions.

If you have any other approach for this then please mention it.

 

Thanks,

Vishwajeet.

 

 

 

4 Replies

  • vishwajeet_hol - Though there is no way other than using Ajax to get the updated content on page, so what you can do is check the count of the posts inside the board "ForumTopicPage" and keep it checking with a thread at the background. A script will check the count every X minutes, if the count is updated, it will fetch the updated content via Ajax.

     

    Count API: http://community.lithium.com/restapi/vc/boards/id/studio/posts/count

     

    Current result = 7397

     

    If after X minutes, the count is same, it wont make a call for the updated content, if the count is now 7398, it will make the update request via Ajax.

     

    http://stackoverflow.com/questions/4930439/call-jquery-ajax-request-each-x-minutes

     

    I hope this helps.

  • dhiraj_gophane's avatar
    dhiraj_gophane
    Leader
    11 years ago
    Hi Alok,

    What if there is any change in body of topic. So there will be loss of data. So can we consider LastUpdateDate instead of replied cout.

    Also this approach will need total customized widget.

    Can we provide data to OOB or can we include OOB component after particular time period.

    Regards,
    Dhiraj
  • VarunGrazitti's avatar
    VarunGrazitti
    Boss
    11 years ago
    Yes, that could be an option as well. Regarding having an OOTB component, No.