Javatpoint Logo
Javatpoint Logo

<apex: pageMessage> Component in Visualforce Page

The <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. id

The 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. detail

The detail attribute is of type string that is used for defining the detailed description of the information.

Syntax:

3. escape

The 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. rendered

The 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. severity

The 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. strength

The 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. summary

The summary attribute is similar to the detail attribute of the component that is used for defining the summary message.

Syntax:

8. title

The 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

apex: pageMessage component in Visualforce Page





Youtube For Videos Join Our Youtube Channel: Join Now

Feedback


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA