-
What are the different types of messaging options in Visualforce page?
Hi All,
What are the different types of messaging options in Visualforce page?
Thanks
Log In to reply.
Activity › Forums › Salesforce® Discussions › What are the different types of messaging options in Visualforce page?
Tagged: Apex Message, Apex Page, Salesforce Apex
Hi All,
What are the different types of messaging options in Visualforce page?
Thanks
Hi Pranav,
The Different type of messaging option are:-
1)Info:-
It is code is Eg:-
<apex:page >
<apex:pageMessage summary=”This is a pageMessage” severity=”info” strength=”3″/>
</apex:page>
2) Error :-
It is code is Eg From Standard Controller Message:-
<apex:page >
<apex:pageMessage summary=”This is a pageMessage” severity=”error” strength=”1″/>
</apex:page>
Custom Controller Message:-
<apex:page controller=”TestMessageController”>
<apex:pageMessages />
</apex:page>
public class TestMessageController{
public TestMessageController(){
ApexPages.addMessage(new ApexPages.Message(ApexPages.Severity.ERROR, ‘This is apex:pageMessages’));
}
}
3)Warning :-
The code is:-
<apex:page controller=”WarningMessage”>
<apex:pagemessages />
</apex:page>
public class WarningMessage
{
public WarningMessage()
{
ApexPages.addMessage(new ApexPages.Message(ApexPages.severity.Warning, ‘This is a warning message’));
}
}
4)Confirm
It is code is :-
<apex:page controller=”SuccessMessage”>
<apex:pagemessages />
</apex:page>
public class SuccessMessage
{
public SuccessMessage()
{
ApexPages.addMessage(new ApexPages.Message(ApexPages.severity.Confirm, ‘This is a success message’));
}
}
Log In to reply.