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

Cannot get Rerender after apex:actionFunction to work

In a Controller for a VF page I have the following which opens up a small form. That bit is OK. If an error is returned from that function I want the form to remain showing (it has an error message) but it disappears after the Save button is selected on that small form and I cannot get it to remain. If there is no error then I am expecting processing to continue OK i.e the small form to have disappeared and stay disappeared.

It is this line in the following code extract that I am expecting to change. Any help would be appreciated on what the rerender statement is doing.

 <apex:actionFunction name="saveNewShipTo" action="{!saveNewShipTo}" rerender="shipTo, msgSfdcSave, msgWebService, errmsg" 

<!--embedded New "Ship To" address control -->
<apex:outputpanel styleClass="shipToDialogue" id="dialogPanel" layout="block">
<apex:form id="shipToForm" >
<apex:actionRegion >
    <apex:pageBlock >
          <apex:pageBlockSection columns="1" showHeader="false">
                <apex:repeat value="{!$ObjectType.Ship_To__c.FieldSets.Order_Header}" var="field">
                    <apex:inputField value="{!ShipToProxy[field]}" style="margin-left:10pt;"
                        styleClass="dialogueField {!field}" />

                <apex:actionRegion immediate="true">
                <apex:commandButton value="{!$Label.Get_A_C_Vat_Id}" action="{!getAccountVatId}" status="overlayStatus" reRender="ship_to_vat_id" />
                <apex:inputField id="ship_to_vat_id" value="{!ShipToProxy.VAT_Id2__c}" style="margin-left: 10pt;"
                    styleClass="dialogueField VAT_Id2__c" />
                  <apex:repeat value="{!ShipToAddressFields}" var="shipTo">          
                  <apex:inputField value="{!ShipToProxy[shipTo]}" style="margin-left:10pt;" styleClass="dialogueField {!shipTo}"/>
     <apex:actionFunction name="saveNewShipTo" action="{!saveNewShipTo}" rerender="shipTo, msgSfdcSave, msgWebService, errmsg" status="overlayStatus"/>status="overlayStatus"/>
        //have to do that every time when ShipTo area is re-rendered
<div id="overlay"></div>