So after I have added the reRender to the commandButton I do not see the pagination and if I remove the reRender the pagination works, after spent good amount of time and could not able to figure out and I'm positive that its not finding the Id of the apex:dataTable ? so I looked at the developer console the Id that is generating so the Id is something like this: SearchPage:myform:pb1

So, I tried something like this: but did not work

<apex:commandButton value="Rerender table" action="{!abc}" 


Failed to execute 'postMessage' on 'DOMWindow': The target origin provided ('https://xxxx.salesforce.com') does not match the recipient window's origin ('null').

<apex:commandButton value="Rerender table" action="{!abc}" reRender="pb1"/> 
    <apex:pageBlock columns="1" id="pb1"> 
               <apex:dataTable value="{!abc}" var="wrsa"  >
    </apex:pageBlock >

The error message is a red herring. I think there's something wrong with the VF library, because almost every page I have generates that message at some point. As for the actual cause, the ID value you should be using should be the same as the ID value of whatever you're reRendering, not the generated ID that is used by Visualforce internally. In other words, the code in your question should work just fine. I believe something more nefarious is going on, perhaps the location of button versus the location of the apex:dataTable itself. Try targeting the table directly:

<apex:commandButton ... reRender="myDataTable">
<apex:dataTable ... id="myDataTable">

Pro Tip: If you need to reRender multiple areas, you can provide a comma-separated list of Visualforce ID values.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.