0

I have this outputText block within the dateSelection pageBlock of my page.

<apex:outputText styleClass="dates" value="{0,date,MMM'.'dd', 'yyyy}">
     <apex:param value="{!propertyRate.Date__c}" /> 
</apex:outputText>

Here I have a save button. When I hit save, the dateSelection pageBlock rerenders. For some reason, the outputText above is the only part of the pageBlock that does NOT rerender. See image below.

<apex:pageBlockButtons location="bottom">
    <apex:commandButton action="{!save}" value="Save" rerender="dateSelection" status="updateDay"></apex:commandButton>
    <apex:actionStatus id="updateDay" startText="updating..." stopText=""/> 
</apex:pageBlockButtons>

Before Hitting Save Before Hitting Save

After Hitting Save (The bolded dates disapear in the left panel) enter image description here

VF Page

    <apex:form >

        <apex:actionFunction name="dateSelected" action="{!setDate}" status="updatestatus" rerender="div">
            <apex:param name="dateId" value="" />
        </apex:actionFunction>
        <apex:actionStatus id="updatestatus" startText="updating..." stopText=""/>        

       <div id="leftBlock">
            <apex:pageBlock id="dateSelection" title="Date Selection">
                <div id="properyRates">
                    <apex:repeat value="{!property_rate_list}" var="propertyRate" id="propertyRateList">
                        <div class="propertyRateDiv">
                            <input type="checkbox" value="{!propertyRate.Id}" class="dateCheckbox" onchange="return verifyChecked($(this), '{!propertyRate.Id}');" />
                            <table class="propertyRateTable">
                                <thead>
                                    <tr>
                                        <apex:outputText id="outputDates" styleClass="dates" value="{0,date,MMM'.'dd', 'yyyy}">
                                            <apex:param value="{!propertyRate.Date__c}" /> 
                                        </apex:outputText>
                                        <input type="hidden" class="property_rate_name" value="{!propertyRate.Name} {!propertyRate.id}"/>
                                    </tr>
                                </thead>               
                                <tbody class="subText">
                                    <tr>
                                        <td>Housekeepers: </td>
                                        <td class="housekeepers">{!propertyRate.Housekeepers__c}</td>
                                    </tr>
                                    <tr>
                                        <td>Properties: </td>
                                        <td class="properties">{!propertyRate.Properties__c}</td>
                                    </tr>
                                </tbody>
                            </table>
                        </div>
                    </apex:repeat>
                </div>
            </apex:pageBlock>
        </div>
        <div id="rightBlock">
            <apex:pageBlock title="Day Overview">
                <apex:pageBlockSection >
                    <apex:inputField value="{!selectedDate.Housekeepers__c}"/>
                </apex:pageBlockSection>

                <apex:pageBlockButtons location="bottom">
                    <apex:commandButton action="{!save}" value="Save" rerender="dateSelection, outputDates" status="updateDay"></apex:commandButton>
                    <apex:actionStatus id="updateDay" startText="updating..." stopText=""/> 
                </apex:pageBlockButtons>

            </apex:pageBlock>

        </div>

    </apex:form>
</apex:page>
2

It looks like you're using two <apex:pageBlock> components but only rerendering one of them (dateSelection).

Give the <apex:outputText> component an ID and then add that ID to the reRender attribute of the <apex:commandButton>

edit

So with your updated outputText:

    <apex:outputText id="outputDates" styleClass="dates" value="{0,date,MMM'.'dd', 'yyyy}">
         <apex:param value="{!propertyRate.Date__c}" /> 
 </apex:outputText>

Update your button to reRender it:

<apex:commandButton action="{!save}" value="Save" rerender="dateSelection, outputDates" status="updateDay"></apex:commandButton>

Also I don't know your full page code so apologies if it's there, but you should add a messages component to display any errors that occur:

<apex:pageMessages id="messageBlock" />

Then update your buttons to reRender this too:

<apex:commandButton action="{!save}" value="Save" rerender="dateSelection, outputDates, messageBlock" status="updateDay"></apex:commandButton>
| improve this answer | |
  • Is this how it should be written? (With a comma separating them) rerender="dateSelection, outputDates" If so, that didn't work – Alex Brigham Nov 10 '15 at 14:38
  • Do you have any other suggestions? – Alex Brigham Nov 10 '15 at 14:44
  • Yes comma separate the IDs, that should work. Could you post your full page code? – Davin Casey Nov 10 '15 at 14:49
  • Yep! I've just posted the VF portion of the page. Let me know if you need CSS or JS, but they aren't that relevant to this. – Alex Brigham Nov 10 '15 at 14:52
  • Updated my post. – Davin Casey Nov 10 '15 at 15:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.