Visualforce PageMessage Samples

Nov 24, 2017 | Apex, Visualforce

Written By

I can never remember what the different Visualforce page message options look like between the severity and strength so here are the options along with the code.

<apex:page title="Visualforce pageMessage Samples"> 
<apex:form > 
<apex:pageMessage title="Message Title" summary="Strength:0, Severity:Confirm" strength="0" severity="confirm" /> 
<apex:pageMessage title="Message Title" summary="Strength:1, Severity:Confirm" strength="1" severity="confirm" /> 
<apex:pageMessage title="Message Title" summary="Strength:2, Severity:Confirm" strength="2" severity="confirm" /> 
<apex:pageMessage title="Message Title" summary="Strength:3, Severity:Confirm" strength="3" severity="confirm" /> 
<apex:pageMessage title="Message Title" summary="Strength:3, Severity:Info" strength="3" severity="info" /> 
<apex:pageMessage title="Message Title" summary="Strength:3, Severity:Warning" strength="3" severity="warning" /> 
<apex:pageMessage title="Message Title" summary="Strength:3, Severity:Error" strength="3" severity="error" /> 
</apex:form> 
</apex:page>

Written By

undefined

You Might Also Like

Visualforce Date Popup

If you work with Visualforce and the first field on your page is a date you'll notice that when the page loads it'll automatically open the date picker which is often not desirable. To fix this simply place this Javascript on your page: <Script> function...

read more

Apex Tip: How to get a RecordType Id by without SOQL

Instead of using this: [Select id from RecordType where sObjectType = 'Account' and developerName ='Customer'].id Use this: Schema.SObjectType.Account.getRecordTypeInfosByName().get('Customer').getRecordTypeId() This can help avoid those pesky SOQL governor limits.

read more

0 Comments