0

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" 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>
2

All you need to do is rerender the buttonPanel since you already have a flag to indicate it has been saved. Ensure you have set inSubmissionProcess to true in your controller or add a new flag to indicate the button should not be rendered

    <apex:commandButton value="Save & Submit Request" action="{!SaveAndSubmit}" 
reRender="msgs, buttonPanel" status="AjaxStatus" id="btnSubmit" rendered="
{!not(inSubmissionProcess)}" />

In order to conditionally hide or show an element you need to rerender the containing element

1

Eric is correct, you just need, as Eric did, add on the save & submit button within the rerender statement the "buttonpanel" and ensure that after save & submit is click your boolean inSubmissionProcess evaluates to true.

that way the save action will set you boolean to true and rerenders the button panel and your save button should not be shown as the rendered sattement will return false becasue of your NOT(inSubmissionprocess)

the main thing is the line / reRender="msgs, buttonPanel" / you has only msgs in there. also the inSubmissionprocess should return TRUE once save is click.

If you use this boolean for other parts too, then you will need to have an additional flag

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.