You need to sign in to do that
Don't have an account?
Denys Peres
Rerender not fetching new data
Hi. I am trying to use actionPoller to fetch data updated through a @future call (just the field being updated asyncronously, Future_Date__c), but it seems that the data in the StandardController is stuck in the original value, even though the fetch date is changed. Do you know how to trigger the standard controller to get the new data and refresh that part of the view?
<apex:page standardController="Case" cache="false" > <apex:pageBlock > <apex:pageBlockSection > <apex:outputPanel id="blockToRerender" > <apex:form > <apex:outputLabel value="Future Date: " /> <apex:actionStatus id="counterStatus" startText="Fetching…" stopText="Done!" rendered="{!ISBLANK(Case.Future_Date__c)}" /> <apex:outputText value="{!Case.Future_Date__c}" /> <br/><br/> <apex:outputLabel value="Fetch Date: " /> <apex:outputText value="{!Now()}" /> <apex:actionPoller oncomplete="refreshJS();" interval="5" status="counterStatus" enabled="{!ISBLANK(Case.Future_Date__c)}" /> <apex:actionFunction name="refreshJS" reRender="blockToRerender" /> </apex:form> </apex:outputPanel> </apex:pageBlockSection> </apex:pageBlock> </apex:page>
I think your expected data (Future_date__c) would only be rendered (refreshed) on page if it is bind with a variable( public getter ) in controller. Right now your field is a part of standard controller and there is not method ( with logic) implemented behind the screen which can be executed in given time interval and provide you updated result on screen.
If this helped you to resolve your problem then please mark this as best answer so that it can be useful for others. .
Thanks
Sandeep Singhal
http://www.codespokes.com/
All Answers
I think your expected data (Future_date__c) would only be rendered (refreshed) on page if it is bind with a variable( public getter ) in controller. Right now your field is a part of standard controller and there is not method ( with logic) implemented behind the screen which can be executed in given time interval and provide you updated result on screen.
If this helped you to resolve your problem then please mark this as best answer so that it can be useful for others. .
Thanks
Sandeep Singhal
http://www.codespokes.com/
I figured it had something to do with the standard controller behavior, so you could either write a custom controller or make an extension that always fetches the data, no matter if the sObj is null or not:
And then...
Unpolished, but it works. Thanks!