apex:pageMessage

This component should be used for presenting custom messages in the page using the Salesforce pattern for errors, warnings and other types of messages for a given severity. See also the pageMessages component.

Example 

1<apex:page standardController="Opportunity" recordSetVar="opportunities"
2    tabStyle="Opportunity" sidebar="false">
3    <p>Enter an alphabetic character for the "Close Date," 
4       then click Save to see what happens.</p>
5    <apex:form >
6        <apex:pageBlock >
7        <apex:pageMessage summary="This pageMessage will always display. Validation error 
8           messages appear in the pageMessages component." severity="warning" strength="3" />
9        <apex:pageMessages />
10        <apex:pageBlockButtons >
11            <apex:commandButton value="Save" action="{!save}"/>
12        </apex:pageBlockButtons>
13            <apex:pageBlockTable value="{!opportunities}" var="opp">
14                <apex:column value="{!opp.name}"/>
15                <apex:column headerValue="Close Date">
16                    <apex:inputField value="{!opp.closeDate}"/>
17                </apex:column>
18            </apex:pageBlockTable>
19        </apex:pageBlock>
20    </apex:form>
21</apex:page>

Attributes 

Attribute NameAttribute TypeDescriptionRequired?API VersionAccess
detailStringThe detailed description of the information. 14.0
escapeBooleanA Boolean value that specifies whether sensitive HTML and XML characters should be escaped in the HTML output generated by this component. If you do not specify escape=“false”, the character escape sequence displays as written. Be aware that setting this value to “false” may be a security risk because it allows arbitrary content, including JavaScript, that could be used in a malicious manner. 14.0
idStringAn identifier that allows the component to be referenced by other components in the page. 14.0global
renderedBooleanA Boolean value that specifies whether the component is rendered on the page. If not specified, this value defaults to true. 14.0global
severityStringThe severity of the message. Values supported are: ‘confirm’, ‘info’, ‘warning’, ‘error’Yes14.0
strengthIntegerThe strength of the message. This controls the visibility and size of the icon displayed next to the message. Use 0 for no image, or 1-3 (highest strength, largest icon). 14.0
summaryStringThe summary message. 14.0
titleStringThe title text for the message. 14.0

See Also