You need to sign in to do that
Don't have an account?
abivenkat
small problem, need urgent help!
hi all,
i am using the <apex:pageMessages /> tag in my vf page on top of the page below the <apex:form> tag. I am adding the below line code
ApexPages.addMessage(new ApexPages.message(ApexPages.severity.Error,'Name cannot be empty.'));
but, the error message is not populating or showing in the <apex:pageMessages /> tag... what i have to do to get this fixed and am i doing any thin wrong or is there anythin wrong with the syntax?? please help. thanks in advance
thanks
abivenkat
SFDC Learner
Can you pls post you code...
I tried very simple code and it works-
<apex:page controller="Example">
<apex:form>
<apex:pageMessages></apex:pageMessages>
</apex:form>
</apex:page>
public class Example
{
public Example()
{
ApexPages.addMessage(new ApexPages.message(ApexPages.severity.Error,'It will display Error.'));
}
}
You need to have Message tag inside tag which rerenders after your event.
eg. if you want message on click of button save and on save button you are rerendering pageblock "ABC". Then message tag should be inside page block ABC.
Regards,
Pankaj Raijade.