apex:pageBlockSectionItem

A single piece of data in an <apex:pageBlockSection> that takes up one column in one row. An <apex:pageBlockSectionItem> component can include up to two child components. If no content is specified, the column is rendered as an empty space. If one child component is specified, the content spans both cells of the column. If two child components are specified, the content of the first is rendered in the left, “label” cell of the column, while the content of the second is rendered in the right, “data” cell of the column.

Note that if you include an <apex:outputField> or an <apex:inputField> component in an <apex:pageBlockSectionItem>, these components do not display with their label or custom help text as they do when they are children of an <apex:pageBlockSection>. Also note that <apex:pageBlockSectionItem> components can’t be rerendered; rerender the child components instead.

This component supports HTML pass-through attributes using the “html-” prefix. Pass-through attributes are attached to the generated container <tr> tag.

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
16            <apex:pageBlockSection title="My Content Section" columns="2">
17                <apex:pageBlockSectionItem>
18                    <apex:outputLabel value="Account Name" for="account__name"/>
19                    <apex:inputText value="{!account.name}" id="account__name"/> 
20                </apex:pageBlockSectionItem>
21
22                <apex:pageBlockSectionItem>
23                    <apex:outputLabel value="Account Site" for="account__site"/>
24                    <apex:inputText value="{!account.site}" id="account__site"/> 
25                </apex:pageBlockSectionItem>
26
27                <apex:pageBlockSectionItem>
28                    <apex:outputLabel value="Account Type" for="account__type"/>
29                    <apex:inputText value="{!account.type}" id="account__type"/> 
30                </apex:pageBlockSectionItem>
31
32                <apex:pageBlockSectionItem>
33                    <apex:outputLabel value="Account Number" for="account__number"/>
34                    <apex:inputText value="{!account.accountNumber}" id="account__number"/> 
35                </apex:pageBlockSectionItem> 
36            </apex:pageBlockSection>
37        </apex:pageBlock>
38    </apex:form>
39</apex:page>

Attributes 

Attribute NameAttribute TypeDescriptionRequired?API VersionAccess
dataStyleStringThe CSS style used to display the content of the right, “data” cell of the pageBlockSection column. 11.0global
dataStyleClassStringThe CSS style class used to display the content of the right, “data” cell of the pageBlockSection column. 11.0global
dataTitleStringThe text displayed when you hover over the right, “data” cell of the pageBlockSection column. 11.0global
dirStringThe direction in which the generated HTML component is read. Possible values include “RTL” (right to left) or “LTR” (left to right). 11.0global
helpTextStringThe help text that is displayed next to this field as a hover-based tooltip, similar to the text that is displayed next to standard Salesforce fields if custom help is defined for the field in Setup. Note that help text only displays if the showHeader attribute of the parent page is set to true. 12.0global
idStringAn identifier that allows the pageBlockSectionItem component to be referenced by other components in the page. 11.0global
labelStyleStringThe CSS style used to display the content of the left, “label” cell of the pageBlockSection column. 11.0global
labelStyleClassStringThe CSS style class used to display the content of the left, “label” cell of the pageBlockSection column. 11.0global
labelTitleStringThe text displayed when you hover over the left, “label” cell of the pageBlockSection column. 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
onDataclickStringThe JavaScript invoked if the onDataclick event occurs–that is, if the user clicks the right, “data” cell of the pageBlockSection column. 11.0global
onDatadblclickStringThe JavaScript invoked if the onDatadblclick event occurs–that is, if the user clicks the right, “data” cell of the pageBlockSection column twice. 11.0global
onDatakeydownStringThe JavaScript invoked if the onDatakeydown event occurs–that is, if the user presses a keyboard key. 11.0global
onDatakeypressStringThe JavaScript invoked if the onDatakeypress event occurs–that is, if the user presses or holds down a keyboard key. 11.0global
onDatakeyupStringThe JavaScript invoked if the onDatakeyup event occurs–that is, if the user releases a keyboard key. 11.0global
onDatamousedownStringThe JavaScript invoked if the onDatamousedown event occurs–that is, if the user clicks a mouse button. 11.0global
onDatamousemoveStringThe JavaScript invoked if the onDatamousemove event occurs–that is, if the user moves the mouse pointer. 11.0global
onDatamouseoutStringThe JavaScript invoked if the onDatamouseout event occurs–that is, if the user moves the mouse pointer away from the right, “data” cell of the pageBlockSection column. 11.0global
onDatamouseoverStringThe JavaScript invoked if the onDatamouseover event occurs–that is, if the user moves the mouse pointer over the right, “data” cell of the pageBlockSection column. 11.0global
onDatamouseupStringThe JavaScript invoked if the onDatamouseup event occurs–that is, if the user releases the mouse button. 11.0global
onLabelclickStringThe JavaScript invoked if the onLabelclick event occurs–that is, if the user clicks the left, “label” cell of the pageBlockSection column. 11.0global
onLabeldblclickStringThe JavaScript invoked if the onLabeldblclick event occurs–that is, if the user clicks the left, “label” cell of the pageBlockSection column twice. 11.0global
onLabelkeydownStringThe JavaScript invoked if the onLabelkeydown event occurs–that is, if the user presses a keyboard key. 11.0global
onLabelkeypressStringThe JavaScript invoked if the onLabelkeypress event occurs–that is, if the user presses or holds down a keyboard key. 11.0global
onLabelkeyupStringThe JavaScript invoked if the onLabelkeyup event occurs–that is, if the user releases a keyboard key. 11.0global
onLabelmousedownStringThe JavaScript invoked if the onLabelmousedown event occurs–that is, if the user clicks a mouse button. 11.0global
onLabelmousemoveStringThe JavaScript invoked if the onLabelmousemove event occurs–that is, if the user moves the mouse pointer. 11.0global
onLabelmouseoutStringThe JavaScript invoked if the onLabelmouseout event occurs–that is, if the user moves the mouse pointer away from the left, “label” cell of the pageBlockSection column. 11.0global
onLabelmouseoverStringThe JavaScript invoked if the onLabelmouseover event occurs–that is, if the user moves the mouse pointer over the left, “label” cell of the pageBlockSection column. 11.0global
onLabelmouseupStringThe JavaScript invoked if the onLabelmouseup 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

See Also