• Master_Key
  • NEWBIE
  • 0 Points
  • Member since 2012

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 1
    Replies

I'm struggling with being able to show a basic success message to the user using the standard <apex:pagemessages /> component.  I've got it on the page, but it never shows a message.  Here's the page:

 

<apex:pageblock > <apex:pageblockSection > <h1>Page Messages:</h1> <apex:pageMessages /> </apex:pageblockSection>

 Nothing unusual there, right?

 

Here's the controller method that generates the message.  Basically I've got a list with checkboxes, and the user selects some, clicks a button, and then records are inserted based on the selections.  When that happens, I'd like to let the user know the insert was successful.

 

 

if (billTos.size() > 0) { try{ insert billTos; // set the message for the user ApexPages.addMessage(new ApexPages.message(ApexPages.severity.INFO,'Bill-To Sites successfully created')); } catch (DMLException e){ // show the messages to the user ApexPages.addMessages(e); } } else { // set the message for the user ApexPages.addMessage(new ApexPages.message(ApexPages.severity.INFO,'No Sites Selected')); }

 

My records are being successfully inserted, so it should be hitting the success message.  But it's all silent on the page -- nary a peep.  What the heck am I doing wrong?  This seems simple!!