apex:pageBlockButtons

A set of buttons that are styled like standard Salesforce buttons. This component must be a child component of an <apex:pageBlock>.

Note that it is not necessary for the buttons themselves to be direct children of the <apex:pageBlockButtons> component—buttons that are located at any level within an <apex:pageBlockButtons> component are styled appropriately.

This component supports HTML pass-through attributes using the “html-” prefix. Pass-through attributes are attached to the generated <td> tag that contains the buttons. This <td> tag can be at the top or bottom, or both, of the <apex:pageBlock>, depending on the value of the location attribute of the <apex:pageBlockButtons> component.

Example 

1<!-- For this example to render properly, you must associate the Visualforce page
2with a valid account record in the URL.
3For example, if 001D000000IRt53 is the account ID, the resulting URL should be:
4https://MyDomain_login_URL/apex/myPage?id=001D000000IRt53
5See the Visualforce Developer's Guide Quick Start Tutorial for more information. -->
6
7
8<!-- Page: -->
9<apex:page standardController="Account">
10    <apex:form>
11        <apex:pageBlock title="My Content" mode="edit">
12            <apex:pageBlockButtons>
13                <apex:commandButton action="{!save}" value="Save"/>
14            </apex:pageBlockButtons>
15            <apex:pageBlockSection title="My Content Section" columns="2">
16                <apex:inputField value="{!account.name}"/>
17                <apex:inputField value="{!account.site}"/>
18                <apex:inputField value="{!account.type}"/>
19                <apex:inputField value="{!account.accountNumber}"/>
20            </apex:pageBlockSection>
21        </apex:pageBlock>
22    </apex:form>
23</apex:page>

Attributes 

Attribute NameAttribute TypeDescriptionRequired?API VersionAccess
dirStringThe direction in which the generated HTML component should be read. Possible values include “RTL” (right to left) or “LTR” (left to right). 11.0global
idStringAn identifier that allows the pageBlockButtons component to be referenced by other components in the page. 11.0global
langStringThe base language for the generated HTML output, for example, “en” or “en-US”. For more information on this attribute, see the W3C specifications. 11.0global
locationStringThe area of the page block where the buttons should be rendered. Possible values include “top”, “bottom”, or “both”. If not specified, this value defaults to “both”. 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. 11.0global
onclickStringThe JavaScript invoked if the onclick event occurs–that is, if the user clicks anywhere in the pageBlockButtons component 11.0global
ondblclickStringThe JavaScript invoked if the ondblclick event occurs–that is, if the user clicks the pageBlockButtons component twice. 11.0global
onkeydownStringThe JavaScript invoked if the onkeydown event occurs–that is, if the user presses a keyboard key. 11.0global
onkeypressStringThe JavaScript invoked if the onkeypress event occurs–that is, if the user presses or holds down a keyboard key. 11.0global
onkeyupStringThe JavaScript invoked if the onkeyup event occurs–that is, if the user releases a keyboard key. 11.0global
onmousedownStringThe JavaScript invoked if the onmousedown event occurs–that is, if the user clicks a mouse button. 11.0global
onmousemoveStringThe JavaScript invoked if the onmousemove event occurs–that is, if the user moves the mouse pointer. 11.0global
onmouseoutStringThe JavaScript invoked if the onmouseout event occurs–that is, if the user moves the mouse pointer away from the pageBlockButtons component. 11.0global
onmouseoverStringThe JavaScript invoked if the onmouseover event occurs–that is, if the user moves the mouse pointer over the pageBlockButtons component. 11.0global
onmouseupStringThe JavaScript invoked if the onmouseup event occurs–that is, if the user releases the mouse button. 11.0global
renderedBooleanA Boolean value that specifies whether the component is rendered on the page. If not specified, this value defaults to true. 11.0global
styleStringThe style used to display the pageBlockButtons component, used primarily for adding inline CSS styles. 11.0global
styleClassStringThe style class used to display the pageBlockButtons component, used primarily to designate which CSS styles are applied when using an external CSS stylesheet. 11.0global
titleStringThe text to display as a tooltip when the user’s mouse pointer hovers over this component. 11.0global

See Also