Note: This release is in preview. Features described here don’t become generally available until the latest general availability date that Salesforce announces for this release. Before then, and where features are noted as beta, pilot, or developer preview, we can’t guarantee general availability within any particular time frame or at all. Make your purchase decisions only on the basis of generally available products and features.
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 Name | Attribute Type | Description | Required? | API Version | Access |
|---|---|---|---|---|---|
| detail | String | The detailed description of the information. | 14.0 | ||
| escape | Boolean | A 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 | ||
| id | String | An identifier that allows the component to be referenced by other components in the page. | 14.0 | global | |
| rendered | Boolean | A Boolean value that specifies whether the component is rendered on the page. If not specified, this value defaults to true. | 14.0 | global | |
| severity | String | The severity of the message. Values supported are: 'confirm', 'info', 'warning', 'error' | Yes | 14.0 | |
| strength | Integer | The 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 | ||
| summary | String | The summary message. | 14.0 | ||
| title | String | The title text for the message. | 14.0 |