function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
xnxn 

updateMsg

Is there a way to attach a non-error message to an inputField?  We want to render a message like the messages within span.updateMsg tags on the Stay-in-Touch confirmation page (/cntc/cntcupdate/contactverify.jsp).  Should we just use outputText or is there a better way to do this, e.g. something like sObject.field.addMessage(
ApexPages.Message)?

 

Thanks,

Christian

sandersensandersen
I have used the OutputText method before. Not sure if there is a better way.
xnxn

It's a bit verbose, but it's not too bad:

<apex:pageBlockSectionItem>
     <apex:outputLabel for="firstname" value="First Name"/>
     <apex:outputPanel layout="block">
          <apex:inputField id="firstname" value="{!MyObject__c.FirstName__c}"/>
          <apex:outputText styleClass="updateMsg" value="Previous: {!previousFirstName}"
            rendered="{!NOT(ISNULL(previousFirstName))}"><br/></apex:outputText>
     </apex:outputPanel>
</apex:pageBlockSectionItem>