I have a two command buttons that are able to save a record. One button fully submits the record and sends it to the edit view. The other save button will update the record if there is anything the user would like to change. I want to make it so the update button only appears in the edit view page, and the submit button shows in the initial creation of the new record to be submitted.
Page
<apex:pageBlockSection id="buttonSection">
<apex:pageBlockSectionItem >
<apex:outputPanel id="buttonPanel">
<div align="right">
<apex:commandButton value="UPDATE" action="{!pageUpdate}" />
<apex:commandButton value="Save & Submit Request" action="{!SaveAndSubmit}" reRender="msgs, buttonPanel" status="AjaxStatus" id="btnSubmit" rendered="{!not(inSubmissionProcess)}"/>
<apex:actionStatus id="AjaxStatus" onstart="DisableButton()" onstop="EnableButton()"></apex:actionStatus>
<apex:commandButton value="Cancel" immediate="true" html-formnovalidate="formnovalidate" action="{!Cancel}"/>
</div>
</apex:outputPanel>
</apex:pageBlockSectionItem>
</apex:pageBlockSection>
Controller
public Boolean getInSubmissionProcess() {
if(inSubmissionProcess == null) {
if(cardRequest.ID == null) {
inSubmissionProcess = false;
}
else {
inSubmissionProcess = true;
}
}
return inSubmissionProcess;
}
What must I do differently to have the update button show on the edit page, and the submit button show on the record creation page?