I have an apex command button inside apex form with it's action calling an apex pagereference method.
This makes the page reload every time I click the button. Can someone please help regarding this?
Apex Command Button
<apex:commandButton value="Apply Outcome" action="{!updatei}" onclick="return false;" disabled="{!oInc.Confirm_Attestation_abv__c==true}"/>
Best Answer
use
reRender
attribute on apex:commandButtonhere is a nice article Implementing Partial Page Updates with Command Links and Buttons where all required steps are listed
<apex:outputPanel>
tag, and give the output panel an id parameter. The value of id is the name that we can use elsewhere in the page to refer to this area. It must be unique in the page.reRender
attribute to the<apex:commandLink>
tag, and give it the same value that was assigned to the output panel's id.lets, say, you want to have whole
apex:form
to be rerendered.at same time method
updatei
should bevoid
or returnnull
.