You need to sign in to do that
Don't have an account?
Maf_007
Action Function not Invoking the referenced method
Hi All,
I am trying to do a really simple thing here but it's not working. I am trying to display a page message from action function method but it's not working. I have checked the debug log as well but it seems like it's not invoking the method at all. Could anyone see if I am doing anything wrong here:
Thanks in advance!
I am trying to do a really simple thing here but it's not working. I am trying to display a page message from action function method but it's not working. I have checked the debug log as well but it seems like it's not invoking the method at all. Could anyone see if I am doing anything wrong here:
<apex:page standardController="MyObject__c" extensions="MyControllerExt" > <apex:form id="MainForm"> <apex:actionFunction name="InvokeActionFunction" action="{!InvokeActionFunction}" rendered="{!displayactionfunction}" reRender="MainForm,Msg"/> <apex:pageBlock> <apex:pageBlockSection> <apex:messages id="Msg"/> </apex:pageBlockSection> </apex:pageBlock> </apex:form> </apex:page> Controller Ext: public class MyControllerExt{ Public static Customer__c Cus {get; set;} public boolean displayactionfunction{get; set;} public MyControllerExt(ApexPages.StandardController CusController) { System.debug('Record to process is: ------------->'+CusController.getRecord()); Cus = (Customer__c)CusController.getRecord(); displayactionfunction = true; } Public void InvokeActionFunction() { ApexPages.Message myMsg = new ApexPages.Message(ApexPages.Severity.FATAL,System.Label.Problem_Saving_Record); ApexPages.addMessage(myMsg); System.debug('Page Message is-------------------------------->'+myMsg); displayactionfunction = false; } }
Thanks in advance!
ActionFunction behind the scenes is nothing but a Javascript function that calls one of the methods in our controller. (similar to JS Remoting) but only controller methods.
Hope this helps
All Answers
ActionFunction behind the scenes is nothing but a Javascript function that calls one of the methods in our controller. (similar to JS Remoting) but only controller methods.
Hope this helps
<apex:pageMessages id="theMessages"/> tag to display the messages on Visualforce page