+ Start a Discussion
Kelly KKelly K 

rerender in apex:pageMessage not working

Hi All,

I've been pulling my hair out trying to figure out why changing the Case.Type drop down to 'Remove Providers' will not display the apex:pageMessage with a required disclaimer that we need. I don't see anything in the documentation that would otherwise suggest that this will not work. Any ideas? I've tried using a controller as well to update boolean variable and that had no effect either.

Here's my code:

<apex:page standardController="Case" extensions="CP_Case_Extension">
    <apex:sectionHeader title="Case Edit" subtitle="New Case"/>

    <apex:outputPanel id="disclaimerBlock" >
        <apex:pageMessage severity="info" strength="3" escape="false" rendered="{!Case.Type = 'Remove Providers'}"
            summary="By clicking &quot;Accept,&quot; you acknowledge that you may no longer bill for a provider once the provider has been removed. Please complete all outstanding AR before finalizing this change. If applicable, billing changes will be reflected in the invoice for the next full billing cycle."/>
    </apex:outputPanel>    
    
    <br/>

    <apex:form >
        <apex:pageBlock title="Case Edit" mode="Edit" >
            <apex:pageBlockButtons location="top" >
                <apex:commandButton value="Submit" action="{!Save}"/>
                <apex:commandButton value="Cancel" action="{!Cancel}"/>
            </apex:pageBlockButtons>  
            
            <apex:actionRegion>
            <apex:pageBlockSection title="Case Information" columns="1" >
                <apex:inputField required="true" value="{!Case.Subject}"/> 
                <apex:inputField required="true" value="{!Case.Type}">
                    <apex:actionSupport event="onchange" rerender="disclaimerBlock"/>                               
                </apex:inputField> 
            </apex:pageBlockSection> 
            </apex:actionRegion> 
                                         
            <apex:pageBlockSection title="Description Information" columns="1">
                <apex:inputField required="true" value="{!Case.Case_Notes__c}"/>
            </apex:pageBlockSection>   
        </apex:pageBlock>
    </apex:form>
</apex:page>
Thanks!
Kelly
Best Answer chosen by Kelly K
SarfarajSarfaraj
Hi Kelly

Replace this,

<apex:actionRegion>
            <apex:pageBlockSection title="Case Information" columns="1" >
                <apex:inputField required="true" value="{!Case.Subject}"/>
                <apex:inputField required="true" value="{!Case.Type}">
                    <apex:actionSupport event="onchange" rerender="disclaimerBlock"/>                              
                </apex:inputField>
            </apex:pageBlockSection>
          </apex:actionRegion>



With this,
<apex:pageBlockSection title="Case Information" columns="1" >
                <apex:inputField required="true" value="{!Case.Subject}"/>
                <apex:pageBlockSectionItem >
                    <apex:outputLabel for="Type"  value="Type"/>
                    <apex:actionRegion id="Type">
                        <apex:inputField required="true" value="{!Case.Type}">
                            <apex:actionSupport event="onchange" rerender="disclaimerBlock"/>                               
                        </apex:inputField>
                    </apex:actionRegion>
                </apex:pageBlockSectionItem> 
            </apex:pageBlockSection>

Hope this helps.

All Answers

SarfarajSarfaraj
Hi Kelly

Replace this,

<apex:actionRegion>
            <apex:pageBlockSection title="Case Information" columns="1" >
                <apex:inputField required="true" value="{!Case.Subject}"/>
                <apex:inputField required="true" value="{!Case.Type}">
                    <apex:actionSupport event="onchange" rerender="disclaimerBlock"/>                              
                </apex:inputField>
            </apex:pageBlockSection>
          </apex:actionRegion>



With this,
<apex:pageBlockSection title="Case Information" columns="1" >
                <apex:inputField required="true" value="{!Case.Subject}"/>
                <apex:pageBlockSectionItem >
                    <apex:outputLabel for="Type"  value="Type"/>
                    <apex:actionRegion id="Type">
                        <apex:inputField required="true" value="{!Case.Type}">
                            <apex:actionSupport event="onchange" rerender="disclaimerBlock"/>                               
                        </apex:inputField>
                    </apex:actionRegion>
                </apex:pageBlockSectionItem> 
            </apex:pageBlockSection>

Hope this helps.
This was selected as the best answer
Kelly KKelly K
Thank you Akram - this works!