You need to sign in to do that
Don't have an account?
Collaborative e
Default text disappears from field when partial page refresh executes
I have a visualforce page that does a rerender on a a PageBlock when a field is updated. When that code executes any field that contains default text loses it's default text. How can I rerender the block but keep my default text?
<apex:page standardController="Proposal_Initiation_Form__c" > <apex:sectionHeader title="Edit Creative Proposal Initiation Form" subtitle="{!Proposal_Initiation_Form__c.name}"/> <apex:form > <apex:pageBlock title="Edit Creative PIF" id="thePageBlock" mode="edit"> <apex:pageMessages /> <apex:pageBlockButtons > <apex:commandButton value="Save" action="{!save}"/> <apex:commandButton value="Cancel" action="{!cancel}"/> </apex:pageBlockButtons> <apex:actionRegion > <apex:pageBlockSection title="General Information" columns="1"> <apex:inputField value="{!Proposal_Initiation_Form__c.name}" required="true"/> <apex:inputField value="{!Proposal_Initiation_Form__c.Account__c}" required="true"/> <apex:inputField value="{!Proposal_Initiation_Form__c.Opportunity__c}"/> <apex:inputField value="{!Proposal_Initiation_Form__c.Is_there_an_RFP__c}"/> <apex:inputField value="{!Proposal_Initiation_Form__c.Request__c}"/> <apex:inputField value="{!Proposal_Initiation_Form__c.Proposal_Budget__c}" required="true"/> <apex:inputField value="{!Proposal_Initiation_Form__c.Presentation_Budget__c}" required="true"/> <apex:pageBlockSectionItem > <apex:outputLabel value="Customer Type"/> <apex:outputPanel > <apex:inputField value="{!Proposal_Initiation_Form__c.Customer_Type__c}" required="true"> <apex:actionSupport event="onchange" rerender="thePageBlock" status="status"/> </apex:inputField> <apex:actionStatus startText=" applying value . . ." id="status"/> </apex:outputPanel> </apex:pageBlockSectionItem> <apex:inputField value="{!Proposal_Initiation_Form__c.Business_Lead__c}"/> </apex:pageBlockSection> </apex:actionRegion> <apex:pageBlockSection title="Show Management Customer Information" columns="2" rendered="{!Proposal_Initiation_Form__c.Customer_Type__c == 'Show Management'}"> <apex:inputField value="{!Proposal_Initiation_Form__c.Number_of_Events__c}" /> <apex:inputField value="{!Proposal_Initiation_Form__c.Portfolio_Value__c}"/> </apex:pageBlockSection> <apex:pageBlockSection title="Customer Information (Single Show)" columns="2" rendered="{!Proposal_Initiation_Form__c.Customer_Type__c == 'Corporate'}"> <apex:inputField value="{!Proposal_Initiation_Form__c.Event_s__c}" /> <apex:inputField value="{!Proposal_Initiation_Form__c.Event_Date_s__c}" required="true"/> <apex:inputField value="{!Proposal_Initiation_Form__c.Show_City_ies__c}"/> <apex:inputField value="{!Proposal_Initiation_Form__c.Producing_Branch_es__c}"/> <apex:inputField value="{!Proposal_Initiation_Form__c.Facility_ies__c}"/> <apex:inputField value="{!Proposal_Initiation_Form__c.Opportunity_Value__c}"/> <apex:inputField value="{!Proposal_Initiation_Form__c.Number_of_Attendees__c}"/> <apex:inputField value="{!Proposal_Initiation_Form__c.Number_of_Exhibitors__c}"/> </apex:pageBlockSection> <apex:pageBlockSection title="Association Customer Information" columns="2" rendered="{!Proposal_Initiation_Form__c.Customer_Type__c == 'Association'}"> <apex:inputField value="{!Proposal_Initiation_Form__c.Number_of_Events__c}" /> <apex:inputField value="{!Proposal_Initiation_Form__c.Portfolio_Value__c}"/> </apex:pageBlockSection> <apex:pageBlockSection title="Scope of Work Information" columns="1"> <apex:inputField value="{!Proposal_Initiation_Form__c.Scope_of_Work_for_this_Proposal__c}" style="width:90%" required="true"/> <apex:inputField value="{!Proposal_Initiation_Form__c.Strategic_Value__c}" style="width:90%"/> <apex:inputField value="{!Proposal_Initiation_Form__c.Deliverables__c}" required="true"/> <apex:inputField value="{!Proposal_Initiation_Form__c.Capabilities_Included_in_Response__c}"/> </apex:pageBlockSection> <apex:pageBlockSection title="Proposal Due Dates" columns="2"> <apex:inputField value="{!Proposal_Initiation_Form__c.Submission_of_intent_to_bid__c}" required="true"/> <apex:inputField value="{!Proposal_Initiation_Form__c.Questions_Due_to_Customer__c}" required="true"/> <apex:inputField value="{!Proposal_Initiation_Form__c.Discovery_meeting_with_customer__c}" required="true"/> <apex:inputField value="{!Proposal_Initiation_Form__c.Walk_through_Site_Visit__c}" required="true"/> <apex:inputField value="{!Proposal_Initiation_Form__c.Physical_Proposal_Delivery__c}" required="true"/> <apex:inputField value="{!Proposal_Initiation_Form__c.Proposal_Submission_Type__c}" required="true"/> <apex:inputField value="{!Proposal_Initiation_Form__c.Stand_up_Presentation_Date__c}" required="true"/> <apex:inputField value="{!Proposal_Initiation_Form__c.Customer_Decision_Date__c}" required="true"/> </apex:pageBlockSection> </apex:pageBlock> </apex:form> </apex:page>
If you want to only refresh a certain section of the page and leave the rest of it alone then firstly I suggest narrowing down your rerender from the whole page block to a smaller section, like a page block section. Following that you can wrap any area that you dont want to change inside an apex:actionRegion component. Read the component guide for more info on this component.
Steven
Thanks for the tips Steven. There are 3 page blocks that I need to rerender based on the onchange event near the top of the code. How would I narrow it down to just those page blocks?
Any examples or help is appreciated.
Give the pageblocks IDs and put them in the rerender="ID1, ID2, ID3"
My apologies for being dense. Here's how I updated the code and I'm still getting the same error. Any advice is appreciated:
I gave each pageBlockSection and id and then called the 3 blocks I wanted to rerender. Now nothing new shows when I change the dropdown.
Where are the fields that contain defaul text that disappears??
It's in pageBlockSection id5. Field is "
Thanks to all who added to the solution. I encapsulated what I wanted to rerender in an <apex:outputPanel id="thePanel"> and then calling to rerender "thePanel". Working code is below.