You need to sign in to do that
Don't have an account?
Gobbledigook
Apex:messages not working
Ok, so for some reason my Messages aren't being displayed, even though I (Seem to) have everything all set up.
VF page setting up the messages:
<apex:messages rendered="true" style="color:Red;"/>
Apex Code calling and creating a message:
ApexPages.addMessage(new ApexPages.Message(ApexPages.severity.INFO, 'Call Attendees: ' + CallAttendeeSum + 'uploaded'));
I get no compile errors, no errors of any kind at all, the message just does not display. What gives?
Thank you for your replies, but for some reason that didn't work either. I found a workaround using <apex:outputText> and resetting the string to the error message and calling a rerender, but for some reason apex:messages still wouldn't work.
Thank you for your replies!
(Oh, and just incase someone else may need this workaround):
In Apex Class:
And Visualforce:
This actually has the added benefit of being able to render messages ANYWHERE on your Visualforce page, other than being limited to the standard error message.
Thanks for your help though all!
All Answers
Have you tried <apex:PageMessages /> ?
If you are invoking an action from VF page, then you should rerender the apex:pageMessages tag using the id.
ex: <apex:pageMessages id='msg' style="your code here"/>
If the apex code you specified is declared in the controller constructor, it should display pageMessage when the VF page gets loaded.
Thank you for your replies, but for some reason that didn't work either. I found a workaround using <apex:outputText> and resetting the string to the error message and calling a rerender, but for some reason apex:messages still wouldn't work.
Thank you for your replies!
(Oh, and just incase someone else may need this workaround):
In Apex Class:
And Visualforce:
This actually has the added benefit of being able to render messages ANYWHERE on your Visualforce page, other than being limited to the standard error message.
Thanks for your help though all!