0
<apex:page id="idPageComponent" standardController='Case' extension='testController'>
<apex:form id="idForm">
    <apex:actionFunction name="testMethod" action="{!testMethodDetails}" reRender="{!$Component.idPageComponent.idForm.outerOutput}{!intNumber}"
                         onComplete="executeAfterComplete('{!$Component.idPageComponent.idForm.outerOutput}{!intNumber}')">
    </apex:actionFunction>
    <apex:repeat value="{!testRule.testInfo}" var="objSections" id="testInfo">
        <apex:outputPanel id="outerOutput">
            <h3>{!objSections.Title}</h3>
            <div class="container-fluid" data-columnNumber="{!objSections.Columns}">
                <div class="slds-grid slds-gutters">
                    <apex:repeat value="{!mapValues[objSections.Id]}" var="sectionFields">
                        <div class="slds-col slds-size_6-of-12">
                            <apex:variable var="c" value="{!sectionFields.apiName}"/>
                            <label>{!sectionFields.Labels}
                                <apex:inputField value="{!case[c]}"/>
                            </label>
                        </div>
                    </apex:repeat>
                </div>
            </div>
        </apex:outputPanel>
    </apex:repeat>
</apex:form>
</apex>

The above is in a VF page named test.page. There is a javascript which updates the id attribute in the page, and adds incremental number to it. So say, for the first time when a create button is clicked an action fucntion gets called and the id of span changes from idPageCreateCase:j_id86:idPageComponent:idForm:outerOutput to idPageCreateCase:j_id86:idPageComponent:idForm:outerOutput0. This is just to make sure each outPut panel has a unique id.

So I am also placing the reRender id as {!$Component.idPageComponent.idForm.outerOutput}{!intNumber} so that it finds the proper outputPanel to update. I have even passed {!$Component.idPageComponent.idForm.outerOutput}{!intNumber} from onComplete just to make sure that the id generated is idPageCreateCase:j_id86:idPageComponent:idForm:outerOutput0

But Still the output panel does not rerender. Is there something I am missing?

  • you might be running into this You cannot use the reRender attribute to update content in a table. from doc. I realize this is not a table but repeat shares characteristics. What I've done in the past is to use a wrapper class for each repeat element in the controller and a Boolean isVisible getter as a property of that wrapper class. Then, after action executes, page refreshes and invisible output panels vaporize – cropredy Mar 8 at 0:54
  • I dont want to hide the panels and neither there is any error message, All the panels should be there on UI but only refresh should happen on the particular panel for which the reRender attribute matches. Is there any way? – Nagendra K S Mar 8 at 1:30
  • i remember struggling with this years ago and I ended up rerendering the whole table - but I found this that might help you – cropredy Mar 8 at 2:11

Your Answer

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

Browse other questions tagged or ask your own question.