You need to sign in to do that
Don't have an account?
kory108
actionSupport rerender not working on inputField
Hello,
The below code should show the Marketing_Request__c.Other_Channel__c inputField when a Marketing_Request__c.Channel__c of "Other" is selected, however it appears the page is not rerendering correctly. When a choice of "Other" is selected, the Other Channel inputField is never diplayed.
Any assistance resolving this is much appreciated.
The below code should show the Marketing_Request__c.Other_Channel__c inputField when a Marketing_Request__c.Channel__c of "Other" is selected, however it appears the page is not rerendering correctly. When a choice of "Other" is selected, the Other Channel inputField is never diplayed.
Any assistance resolving this is much appreciated.
<apex:page standardController="Marketing_Request__c"> <apex:sectionHeader title="Edit Marketing Request" subtitle="{!Marketing_Request__c.Name}"/> <apex:form> <apex:pageBlock title="Edit Marketing Request" id="thePageBlock" mode="edit"> <apex:pageMessages /> <apex:pageBlockButtons > <apex:commandButton value="Save" action="{!save}"/> <apex:commandButton value="Cancel" action="{!cancel}"/> </apex:pageBlockButtons> <apex:pageBlockSection title="Branding and Channel" columns="1"> <apex:inputField value="{!Marketing_Request__c.Branding_Type__c}" required="true"/> <apex:inputField value="{!Marketing_Request__c.Channel__c}" required="true"> <apex:actionSupport event="onchange" rerender="thePageBlock" immediate="true" status="channelStatus"/> </apex:inputField> <apex:actionStatus startText="applying change..." id="channelStatus"/> <apex:inputField value="{!Marketing_Request__c.Other_Channel__c}" required="true" rendered="{!Marketing_Request__c.Channel__c == 'Other'}"/> </apex:pageBlockSection> </apex:pageBlock> </apex:form> </apex:page>
when you try to rerender the pageblock entire block will be refreshed. Instead you only refresh part of the block.
Please try this code and let me know if you have any problems
Thanks,
pRAMODH.
All Answers
There is problem while using required = true and Immediate = true while using action support, you need to use Action region to achieve the functionality
Updated Code
Hope this helps
--
Thanks,
Swayam
Thank you for the quick response! After applying your updated code I'm now experiencing an issue where the data in the inputFields are cleared out anytime a new value is selected from the Channel picklist. It appears the system is correctly updating the page, however the data the user entered previous to the actionFunction update is not saved.
when you try to rerender the pageblock entire block will be refreshed. Instead you only refresh part of the block.
Please try this code and let me know if you have any problems
Thanks,
pRAMODH.
Thank you very much - that works perfectly!