Is it possible to re-render the content within a Custom Component from the parent Visualforce Page?
I have a custom component in an apex:outputpanel like so:
<apex:outputPanel id="popup">
<apex:outputPanel styleClass="customPopup" layout="block" rendered="{!displayPopUp}">
<c:BuyingJourneyStageRequirements opportunityId="{!chosenOpp}" pageControllerAttribute="{!this}" id="componentToRerender"/>
<apex:commandButton value="Hide Pop up" action="{!closePopup}" rerender="popup,componentToRerender" oncomplete="componentRerender()"/>
</apex:outputPanel>
</apex:outputPanel>
The Visualforce page supplies an OpportunityId and a copy of the page controller into the component, so that it can display details from the Opportunity. Clicking the "Hide Pop Up" button clears the Opp and OppId in the custom component controller and rerenders the OutputPanel.
The next time the panel is displayed (with a new OpportunityId supplied), the content of the custom component still shows the details of the previous Opportunity, which is not the desired behaviour. It's not until a link within the content within the Custom Component is clicked that the content refreshes, showing the new Opportunity details.
When I check in the debug logs, I know that the new Opportunity is being queried and returned by the controller, so the data is in place, but the re-render of the custom component content doesn't appear to be happening. Is there a way to force a refresh?
With thanks, Andy