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
I think D is correct answer.
apex:pageMessage only display custom message. And with severity is "info", it doesn't display error message.
upvoted 2 times
...
Log in to ExamTopics
Sign in:
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
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, 7 months agosinghkar
Highly Voted 3 years, 5 months agoKeiyo
Most Recent 1 year, 2 months agoSasi7
1 year, 8 months agorufusroffie
1 year, 8 months agoSpiritualBeing
2 years, 3 months agoAjayMehta
2 years, 7 months agoSri_Vathsa
2 years, 11 months agoNPW89
3 years agoshatrughna
3 years agoPratibhadx
3 years, 1 month agoAnhTH
3 years, 1 month ago