<apex: pageMessage> Component in Visualforce PageThe <apex:pageMessage> is another important component that is mainly used for displaying all the success, error, and warning messages of all the components that are presented using SF styling on the current page. We use the <apex: pageMessage> component when we need to display the individual message on the VF page. In the <apex: pageMessage> component, we provide the message which we want to display on the page, so it is a kind of static message. Just like the <apex: page> component, the <apex:pageMessage> component also has some attributes which are used when this component is used on the page. These attributes are as follows: 1. idThe id attribute is of type string, i.e., a unique identifier that is used for allowing the component to be referenced by other components on the page. Syntax: 2. detailThe detail attribute is of type string that is used for defining the detailed description of the information. Syntax: 3. escapeThe escape attribute is of type Boolean that is used for specifying whether the sensitive HTML and XML characters should be escaped in the HTML output generated by the component or not. Syntax: 4. renderedThe rendered attribute is of type Boolean that is used for specifying whether the component is rendered on the page or not. By default, its value is set to true. Syntax: 5. severityThe severity attribute is of type string that is used for specifying the severity of the message. Confirm, info, warning, and error are the supported values for this attribute. Syntax: 6. strengthThe strength attribute is of type integer that is used for specifying the strength of the message for controlling the visibility and icon size displayed next to the message. If we don't want to use an image, we set its value to 0. We set its value to 1-3, i.e., highest strength and largest icon. Syntax: 7. summaryThe summary attribute is similar to the detail attribute of the component that is used for defining the summary message. Syntax: 8. titleThe title attribute is of type string that is used for defining the title text for the message. Syntax: Let's take an example to understand how we can use the <apex: pageMessage> component in the VF page: ApexPageMessageExample.vfp Output
Next Topic
|