Trusted Contributor
Rajesh Shah
Posts: 296
Re: actionSupport rerender problem
[ Edited ]

Found the solution :smileyhappy:: (thanks to Sorna and Edwin)

It seems that if the component that I am rerendering has a rendered attribute, it doesn't works. So I had to wrap the pageBlockSection in an outputPanel with no rerenderd attribute. Now I just rerender the outputPanel. Attached is the updated code .

<apex:form id="AccountForm">
<apex:pageBlock >
<apex:pageBlockButtons >
<apex:commandButton value="Save" action="{!save}" />
<apex:commandButton value="Cancel" action="{!cancel}" />
<apex:commandButton value="Custom Save" action="{!saveCustom}"/>
</apex:pageBlockButtons>
<apex:pageBlockSection >
<apex:inputField value="{!Account.Name}" />
<apex:inputField required="true" value="{!Account.AccountNumber}" />
<apex:inputField value="{!Account.Industry}" />
<apex:inputField value="{!Account.Has_Shipping_Address__c}" >
<apex:actionSupport event="onclick" action="{!changeShippingSection}" rerender="ShippingAddressPanel" status="StatusChange"/>
<apex:actionStatus startText="Updating page ..." id="StatusChange"/>
</apex:inputField>

</apex:pageBlockSection>
<apex:outputPanel id="ShippingAddressPanel">
<apex:pageBlockSection id="ShippingAddressSection" rendered="{!shippingSection}" Title="Shipping Address" >
<apex:inputField value="{!Account.ShippingCity}" />
<apex:inputField value="{!Account.ShippingState}" />
<apex:inputField value="{!Account.ShippingCountry}" />
<apex:inputField value="{!Account.ShippingPostalCode}" />
</apex:pageBlockSection>
</apex:outputPanel>
</apex:pageBlock>
</apex:form>

 

 

 

 

 

 

Message Edited by Rajesh Shah on 10-09-2009 04:47 PM