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

commandButton to refresh current page
I currently have a button that will call out to an external server and retrieve a value. That value is then placed in a field for the same record. Everything works right now. The problem is that instead of refreshing the current tab/page, it opens a new window and the user needs to press Back to see the current data. If they close the new window, then they see the old data. How can I get the button to refresh the current tab/page after updating the value?
Thanks,
Matt
The action was returning null already. However, I found the solution. There is a setting that needs to be changed.
Edit the object that was being refreshed (mine was in App Setup>Create>Objects).
Go to the Custom Button and Link section.
Edit the button that called the problem VisualForce page.
Change the Behavior to any one of the 3 options that start with "Display in existing window...".
Save the Custom Button/Link.
Thanks for helping!
Matt
All Answers
it would be useful it you showed how you do it currently, but in order to just refresh the page you should
return null;
from you controller on the button click.
Here's my code, minus the parts that do the retrieval. You can see that the GetUnitsAvailableOnPage method does return null.
Thanks,
Matt
VisualForce Page:
Extension/Apex class:
I think what your problem might be, is that it looks like you are trying to use that function to help initialize the page. You need to be setting everything up in the constructor instead.
If you look at the action of the ApexPages, the last line says that it should not be used for initialization. I believe this is your problem.
The action was returning null already. However, I found the solution. There is a setting that needs to be changed.
Edit the object that was being refreshed (mine was in App Setup>Create>Objects).
Go to the Custom Button and Link section.
Edit the button that called the problem VisualForce page.
Change the Behavior to any one of the 3 options that start with "Display in existing window...".
Save the Custom Button/Link.
Thanks for helping!
Matt