+ Start a Discussion

How to automatically re-render a pageblock every time a variable is updated?


Let's say a have a certain pageblock inside a visualforce page that I want to be refreshed every time a certain variable (in my controller class) is updated. Do you have any idea of how this can be done??

Thank you!




I am not sure I understand your business requirement or where you are coming from, but I think what you need is "Streaming API".

Please go through: http://wiki.developerforce.com/page/Getting_Started_with_the_Force.com_Streaming_API

We can update VF pages on basis of changes in the server. 


If that is not the case, and you want to update only one user's VF page based on her/ his actions you can use reRender attribute. Because every change by the user is pretty much instantaneously reflected on page. 





Dear Prabha,


Thank you for your reply. What I am looking for is similar to the Streaming API. However, according to the information on the link you have provided, every "topic" must be related to a certain SOQL query. This is not my case.


I am looking for some way of refreshing a page block every time an email is sent by a certain Apex method. For each sent email, the user would see in the page a message stating whether the process was successful.


Please note that reRender attribute alone is not enough, as the user is not doing anything.


Thank you again!