You need to sign in to do that
Don't have an account?
Sergi
showing error messages with javascript alerts
Hi,
I've a custom VF page with a custom controller too. When the controller catches an exception I put it in an ApexPages.Message, and return null (to the VF page).
Is there any way to catch this message with javascript and show an alert with the text?
You cannot net Apex exceptions with JavaScript.
What you can do is add a public member variable to your controller called, say, errorMsg. Then on your VF page add an outputText with value={!errorMsg}. When your whatever button is pressed have it rerender the outputText. So this way when the button is hit your controller does its job and if it catches an exception it prints it to errorMsg.