[SalesForce] ActionFunction is working only with reRender=”” and not with any value inside it

I am experiencing a strange behavior for the first time…

I have a actionFunction in my apex compoenent, which has reRender to some panel id. The panel doesnot reRender at all even though the method is successfully executed at the back end. If I make it empty reRender function and put an alert on complete, this works..

AM I MISSING Something?

<apex:actionFunction name="fetchRecords" action="{!refreshSubCaseRecords}" oncomplete="alert('123')" immediate="true" reRender="refreshPanel" />

Best Answer

Wild guess (you still need to post more code) but rerender only applies to child elements and not the element itself.

For example if you rerender:

<apex:outputText id="output" rendered="{!condition}" value="text" />

it won't work.

But if you change it to(with output panel):

<apex:outputPanel id="output">
    <apex:outputText rendered="{!condition}" value="text" />
</apex:outputPanel>

presto bingo.