- Home
- Technical Library
- Boards
- Cookbook
- Code Share
- Blogs
- Partners
-
More
-
Services
- Training & Certification
- Support
-
Galleries
- Force.com Sites Gallery
- Chatter Challenge Entries
-
Other Web Sites
- Salesforce.com
- Database.com
- AppExchange
- CRM Community
-
Discussions
- Announcements
- General Development
- Schema Development
- New to Cloud Development
- Apex Code Development
- Visualforce Development
- Formulas & Validation Rules Discussion
- Security
- Mobile
- Force.com Sites
- Chatter Development
- Java Development
- .NET Development
- Perl, PHP, Python & Ruby Development
- Adobe Flash Builder for Force.com
- Desktop Integration
- REST API Integration
- Streaming API
- Visual Workflow
- Apple, Mac and OS X
- VB and Office Development
- Excel Connector
- AJAX Toolkit & S-controls
- Force.com Builder & Native Apps
- AppExchange Directory & Packaging
- Force.com Labs Projects
- Open Source
- Site.com
- Jobs Board - Administrators
- Jobs Board - Developers
- Force.com Discussion Boards
- :
- Developer Boards for Force.com and Database.com
- :
- Visualforce Development
- :
- Re: actionSupport rerender problem
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic to the Top
- Bookmark
- Subscribe
- Printer Friendly Page
actionSupp ort rerender problem
[ Edited ]
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
10-08-2009 02:47 AM - last edited on 10-08-2009 07:17 AM
I am having a problem using action Support and rerendering a section.
Following is the page 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="AccountForm" status="StatusChange"/>
<apex:actionStatus startText="Updating page ..." id="StatusChange"/>
</apex:inputField>
</apex:pageBlockSection>
<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:pageBlock>
</apex:form>
In the above code, when the Has Shipping Address field is clicked, the Shipping Address section should be visible. Following is the corresponding controller code
public void changeShippingSection()
{
shippingSection = account.Has_Shipping_Address__c;
//return null;
}
It works perfectly fine when I AccountForm as Id in the rerender attribute. But if I put shippingAddressSection as Id in the attribute, no change happens even though function gets called.
Is this the intended behaviour or am I missing something?
Vote for my ideas
Solved! Go to Solution.
Re: actionSupp ort rerender problem
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
10-09-2009 12:25 AM
Vote for my ideas
Re: actionSupp ort rerender problem
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
10-09-2009 02:52 AM
Hi.. try using an outputpanel and rerender the outputpanel, place your pageblocksection inside the outputpanel..
I too faced a similar issue, but i do not remember the cause... Maybe, the pageblocksection in turn has a rerender which causes the problem..
Cheers!!
Re: actionSupp ort rerender problem
[ Edited ]
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
10-09-2009 04:15 AM - last edited on 10-09-2009 04:17 AM
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>
Vote for my ideas

