I am currently calling an APEX method (in a controller) with variables from Javascript. I would like to reflect the changes made in the controller in the page. I am using an apex:actionFunction
to call the method and then I am using another actionFunction
to reRender
a block of the page. I believe the changes are taking place in the controller (I can make logs of the changes) and I think the rerender is working, but the new values are not being shown on the page. They will only be shown if I force a refresh by pressing a button, or similar.
I have been looking at a number of examples, but I have not found anything useful for this particular issue. Here is a summarized version of my code:
//page
<apex:actionFunction name="rerenderInfoBlock" rerender="InfoBlockContainer" />
...
<apex:actionFunction action="{!runControllerMethod}" name="newCustomerRecruitMonitorSelected" rerender="">
<apex:param name="monitorId" assignTo="{!monitorId}" value="" />
</apex:actionFunction>
...
runControllerMethod(parameterVar);
rerenderInfoBlock();
alert("{!objectReference.changedProperty}");//this property will not be changed
//controller
public PageReference runControllerMethod(){
//get the parameters etc and make a change to a few properties
return null;
}
Is there some step I am missing? I am guessing I have to tell the javascript to somehow go back to the server and get the updated values, but I am not sure how to do this... Would be great if any answers contained links to references. Thanks.
Edit, Here is the output panel that I am trying to rerender:
<apex:outputPanel id="InfoBlockContainer">
<apex:pageBlock id="InfoBlock" rendered="{!showBlock == true}">
...