You need to sign in to do that
Don't have an account?

how to only refresh a page block in VF page by commandButton?
Is it possible to only refresh a page block(not the whole page) after click the commandButton?
I know we can use "rerender" to render a page block, but along with "rerender", the whole page is refreshed. That is not i wanted.
I read the developer guide of VF, it describes commandButton as:
"The button executes an action defined by a controller, and then either refreshes the current page, or navigates to a different page based on the PageReference variable that is returned by the action."
It seems the "refresh" action must be happened once use commandButton.
Is there any away to avoid refreshing the whole page?
I know we can use "rerender" to render a page block, but along with "rerender", the whole page is refreshed. That is not i wanted.
I read the developer guide of VF, it describes commandButton as:
"The button executes an action defined by a controller, and then either refreshes the current page, or navigates to a different page based on the PageReference variable that is returned by the action."
It seems the "refresh" action must be happened once use commandButton.
Is there any away to avoid refreshing the whole page?
Finally I get this by using onClick event and apex:actionFunction conjunctly, the onclick has 'return false' defined:
Thanks
All Answers
Rerender is supposed to refresh only a portion of a page, and is not supposed to refresh the whole page. Can you post your page and controller, or sample page and controller to see what is going wrong.. ?
Thanks for the reply. I have the set the page block Id for the rerender action, below is the code snippet of page block:
And my command button like:
After reading your answers, I'm afraid I didn't describe my original problem clearly. I know after clicking the button, only the data of my "infoPanel" is updated. The data of other page blocks keep same as before the clicking. This is correct. "The whole page refresh", I mean the whole page "blinks" again, just like reloading. I captured a "blink" screenshot after clicking the button:
My intention is to avoid the page "blink", just make the page-block blink. Is this possible?
(pls.let me if the description is confusion)
Thanks
You can referesh your page by two ways.
1. In yourmethod docheck put pagereference code and give the same link.
2. Put oncomplete in your commandlink and reload the page in it like:
Please mark it as best if this helps you.
Regards,
Grazitti Team
www.grazitti.com
Finally I get this by using onClick event and apex:actionFunction conjunctly, the onclick has 'return false' defined:
Thanks