A custom Visualforce controller calls the ApexPages.addMessage() method, but no messages are rendering on the page. Which component should be added to the Visualforce page to display the message?
C is the correct ans since severity is the required tag
refer the below reference
https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_compref_pageMessage.htm
The <apex:pageMessages /> component is used to display all messages that have been added to the page using ApexPages.addMessage(). It is a common way to render messages on a Visualforce page.
Correct answer is D. We should add <apex:pageMessages /> component to the Visualforce page to display the message. This component collects and displays all messages with appropriate styling based on their severity (info, warning, error, etc.).
it is D because you can only use ApexPages.addMessage() to add to <apex:pageMessages/>
C is only single message render the markup value, you cant run addMessage to add more message to it
A voting comment increases the vote count for the chosen answer by one.
Upvoting a comment with a selected answer will also increase the vote count towards that answer by one.
So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.
SalesforceMark
Highly Voted 2 years agosinghkar
Highly Voted 2 years, 11 months agoKeiyo
Most Recent 7 months, 3 weeks agoSasi7
1 year, 1 month agorufusroffie
1 year, 2 months agoSpiritualBeing
1 year, 8 months agoAjayMehta
2 years agoSri_Vathsa
2 years, 5 months agoNPW89
2 years, 5 months agoshatrughna
2 years, 6 months agoPratibhadx
2 years, 7 months agoAnhTH
2 years, 7 months ago