Tag Archives: pageBlockButtons

Display pageBlock Buttons in bottom

We use location attribute in pageBlockButtons to display pageblock button in bottom alone. The possible values of location attribute are “top”, “bottom” and “both”. If not specified, this value defaults to “both”.

Here I’m using location="bottom" to display buttons in bottom only.

<apex:page standardController="Account">
	<apex:form>
		<apex:pageBlock mode="edit">
			<apex:pageBlockButtons location="bottom">
				<apex:commandButton action="{!Save}" value="Save"/>
				<apex:commandButton action="{!Cancel}" value="Cancel" immediate="true" />
			</apex:pageBlockButtons>
			<apex:pageBlockSection columns="2" title="Account Information">
				<apex:inputField value="{!Account.Name}"  required="true"/>
				<apex:inputField value="{!Account.Phone}"/>
			</apex:pageBlockSection>
		</apex:pageBlock>
	</apex:form>
</apex:page>

Note: If a pageBlock header facet is defined, the facet overrides the buttons that would normally appear at the top of the page block. Likewise if a pageBlock footer facet is defined, the facet overrides the buttons that would normally appear at the bottom of the page block.