You need to sign in to do that
Don't have an account?
Sergio Mac Intosh
My apexmessages aren't showed
My apexmessages aren't showed! Can someone help me out?
Visualforce:
Im using it in chatter (VF Chatter Action)
Thanks,
Sergio
Visualforce:
<apex:pageMessages></apex:pageMessages> <apex:form> <apex:actionFunction name="showSuccess" action="{!showSuccess}" rerender="messages"> <apex:param name="message" assignTo="{!message}" value="" /> <apex:param name="messageType" assignTo="{!messageType}" value="" /> </apex:actionFunction> </apex:form>Javascript:
showSuccess('Logo uploaded succesfull', 'SUCCESS');Apex:
public string message{get; set;} public string messageType{get; set;} public void showSuccess(){ if(messageType == 'SUCCESS'){ system.debug('TestMessage' + message); ApexPages.Message alertMsg = new ApexPages.Message(ApexPages.Severity.CONFIRM,'TESTSUCCESS'); ApexPages.addMessage(alertMsg); ///ApexPages.addmessage(new ApexPages.message(ApexPages.severity.CONFIRM, message)); }else if(messageType == 'WARNING'){ ApexPages.addmessage(new ApexPages.message(ApexPages.severity.WARNING, message)); }else if(messageType == 'ERROR'){ ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR, message)); } }My system.debug is visible in the debug logs but the apex message doesn't appear.
Im using it in chatter (VF Chatter Action)
Thanks,
Sergio
If that doesn't work, then post your entire VF. Perhaps somethign else is going on in the markup we can't see.
All Answers
If that doesn't work, then post your entire VF. Perhaps somethign else is going on in the markup we can't see.
1) http://www.sfdcpoint.com/salesforce/show-error-message-visualforce-page/
2) https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/apex_System_ApexPages_addMessage.htm
I hope you added the <Apex:pageMessages tab in your VF page Please add id in pageMessage tag and add rerender="showmsg" tag to refersh.
Like below code.
Apex Class
Let us know if this will help you