You need to sign in to do that
Don't have an account?
miiWorks
Rerender not behaving correcly
Hello, i have a rerender setup on the miiHomeLoan__Financier__c field, which will make the miiHomeLoan__Loan_Product__c field (section) display. It works on a new page, and i can select a value (its a class calling on another object, see class), however when i change it back to "- Select Financier -" (which has/should have a null value), the page does not rerender and remove the section id="loanproduct"
Any ideas?
Class
public class FunderList { private miiHomeLoan__Loan_Split__c loansplit; public FunderList(ApexPages.StandardController controller) { this.loansplit = (miiHomeLoan__Loan_Split__c)controller.getRecord(); } public List <SelectOption> getFunder { Get{ List <SelectOption> funder = new List <SelectOption>(); funder.add(new selectOption('','- Select Financier -')); for( miiHomeLoan__Financier__c fu: [Select Name FROM miiHomeLoan__Financier__c WHERE miiHomeLoan__Active__c = TRUE ]){ funder.add(new selectOption(fu.id, fu.Name)); } return funder; } Set; } }
VF
<apex:page showHeader="true" standardController="miiHomeLoan__Loan_Split__c" extensions="FunderList" id="thePage"> <apex:form id="theForm"> <apex:sectionHeader title="Loan Split" subtitle="New Loan Split"/> <apex:pageBlock title="Loan Split Edit"> <apex:pageMessages /> <apex:pageBlockButtons > <apex:commandButton action="{!save}" value="Save"/> <apex:commandButton action="{!cancel}" value="Cancel"/> </apex:pageBlockButtons> <apex:pageBlockSection title="Information" columns="2" collapsible="true"> <apex:inputField value="{!miiHomeLoan__Loan_Split__c.miiHomeLoan__Loan_Split_Amount_Dollars__c}" required="true" /> <apex:inputField value="{!miiHomeLoan__Loan_Split__c.miiHomeLoan__Loan_Application__c}" required="true" /> <apex:pageblockSectionItem > <apex:outputLabel value="Financier"/> <apex:actionRegion > <apex:selectList id="funder" value="{!miiHomeLoan__Loan_Split__c.miiHomeLoan__Financier__c}" size="1" title="Financier" required="true" > <apex:selectOptions value="{!getFunder}"/> <apex:actionSupport event="onchange" status="StatusChange" rerender="loanproduct"/> </apex:selectList> <apex:actionStatus startText="Refreshing..." id="StatusChange"/> </apex:actionRegion> </apex:pageblockSectionItem> <apex:outputPanel id="loanproduct"> <apex:pageblockSectionItem > <apex:inputField value="{!miiHomeLoan__Loan_Split__c.miiHomeLoan__Loan_Product__c}" required="true" /> </apex:pageblockSectionItem> </apex:outputPanel> <apex:inputField value="{!miiHomeLoan__Loan_Split__c.miiHomeLoan__Repay_Type__c}" required="true" /> <apex:inputField value="{!miiHomeLoan__Loan_Split__c.miiHomeLoan__Account_Number__c}" required="false" /> <apex:inputField value="{!miiHomeLoan__Loan_Split__c.Purpose__c}" required="true" /> <apex:inputField value="{!miiHomeLoan__Loan_Split__c.miiHomeLoan__Financier_Split_ID__c}" required="false" /> <apex:inputTextarea cols="40" value="{!miiHomeLoan__Loan_Split__c.Loan_Purpose_Note__c}" required="false" /> <apex:inputTextarea cols="40" value="{!miiHomeLoan__Loan_Split__c.Repayment_to_Come_From__c}" required="false" /> <apex:inputField value="{!miiHomeLoan__Loan_Split__c.miiHomeLoan__Loan_Split_Status__c}" required="true" /> <apex:inputField value="{!miiHomeLoan__Loan_Split__c.miiHomeLoan__Deduct_Term__c}" required="false" /> </apex:pageBlockSection> </apex:pageBlock> </apex:form> </apex:page>
It might not be null, but blank.
instead of == null or ISNULL()
use
== '' or ISBLANK()
Thanks, i tried the following, no joy