You need to sign in to do that
Don't have an account?
GlennAtAppirio
Adding Apex Messages During Initial Page Load
We're using the <apex: pageMessages> tag to set and display error messages to users.
However, the tag doesn't seem to display if messages are set (via ApexPages.addMessage()) during the initial page load, i.e. within the controller's constructor. The page messages display fine upon any reload (e.g. after calling an action from a button).
This is unfortunate. We do lots of lookups in the constructor based on URL parameters, and want to display error messages in certain situations.
We've hacked around this for now by re-creating the <apex: pageMessages> look & feel within an apex: outputPanel, and then writing some controller code to parse the existing message list and set a member variable accordingly. But this is definitely a hack.
Are we missing something? We'd love to be able to set and display <apex: pageMessages> during the initial page load.
Message Edited by GlennAtAppirio on 09-22-2008 09:16 AM
However, the tag doesn't seem to display if messages are set (via ApexPages.addMessage()) during the initial page load, i.e. within the controller's constructor. The page messages display fine upon any reload (e.g. after calling an action from a button).
This is unfortunate. We do lots of lookups in the constructor based on URL parameters, and want to display error messages in certain situations.
We've hacked around this for now by re-creating the <apex: pageMessages> look & feel within an apex: outputPanel, and then writing some controller code to parse the existing message list and set a member variable accordingly. But this is definitely a hack.
Are we missing something? We'd love to be able to set and display <apex: pageMessages> during the initial page load.
Message Edited by GlennAtAppirio on 09-22-2008 09:16 AM
Thanks for the quick response!