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
Sparty OnSparty On 

Rerendering Visualforce Page

I have a very basic Visualforce page that displays multiple Pagemessages at the top of the page if certain fields are not filled out.  The Visualforce page is overriding the View mode of the Opportunity.  The Pagemessages update correctly when a user clicks Edit and updates the null field values.  However, when a user uses inline editing to update one of the fields and clicks Save, the Pagemessage(s) stay displayed.  How can I make it so that the Pagemessages update after someone edits the Opportunity using inline editing?  If a user updates one of the two fields with inline editing then I would like the messages to go away after the record is saved.  My code is below.

 

<apex:page standardController="Opportunity" >
    
    <apex:pagemessage summary="Number of Eligible Retirees is null." severity="warning" strength="1" rendered="{!Opportunity.Number_of_Eligible_Retirees__c==null}" />
    <apex:pagemessage summary="Current Rates is null." severity="warning" strength="1" rendered="{!Opportunity.Current_Rates__c==null}" />
    
    <apex:detail inlineEdit="true" rerender="{!Opportunity.id}" />
    
</apex:page>
shruthishruthi

This should work for you.

 

<apex:page standardController="Opportunity" >
    <apex:detail inlineEdit="true" rerender="{!Opportunity.id}" >
    <apex:pagemessage summary="Number of Eligible Retirees is null." severity="warning" strength="1" rendered="{!Opportunity.Number_of_Eligible_Retirees__c==null}" />
    <apex:pagemessage summary="Current Rates is null." severity="warning" strength="1" rendered="{!Opportunity.Current_Rates__c==null}" />
    </apex:detail>
</apex:page>

Let me know if you face further issues with InlineEdit!

Sparty OnSparty On

Thank you for the help.  It works with inline editing now, however the error messages are showing up at the very bottom, underneath the related lists.  How can I make the error messages show up at the top of the page?