You need to sign in to do that
Don't have an account?
dfpitt
Calling function in APEX controller from VF without a refresh
Hello,
I have a function in an APEX controller that changes the data in a custom field and updates the custom object.
I'm trying to call it from a VF page, without having the page refresh. I tried:
- Calling it from an APEX:CommandButton
- Calling it from javascript using an APEX:ActionFunction
<apex:actionFunction name="the_function" action="{!Function}" id="action_thefunction"/>
In both cases, the APEX function runs and then the VF page refreshes.
How can I avoid the refresh?
You need to use the rerender attribute (on either commandButton or actionFunction) to specify which parts of the page should be updated after the action. Otherwise the whole page is updated.
All Answers
You need to use the rerender attribute (on either commandButton or actionFunction) to specify which parts of the page should be updated after the action. Otherwise the whole page is updated.
Thanks aballard, that worked perfectly.
I created an empty apex:outputpanel, and I'm rerendering it from the actionFunction.