Below is my controller class code
public Account acctObj {
get;
set {
new Account();
}
}
public boolean checkMessageFlag {
get;
set {
checkMessageFlag = true;
}
}
public PageReference updateViewStateForCreditCheckMessage() {
if(acctObj.Decline_Credit_Check__c == true) {
checkMessageFlag = false;
}
return null;
}
And below is the markup for my Visualforce Page
<apex:outputLabel id="creditCheckMessageId" value="*Credit Check has not been performed"
style="font-size: inherit;color:red;" rendered="{!checkMessageFlag}" ></apex:outputLabel>
<br></br>
<apex:outputLabel ><apex:inputField value="{!acctObj.Decline_Credit_Check__c}">
<apex:actionSupport event="onchange"
action="{!updateViewStateForCreditCheckMessage}"
reRender="creditCheckMessageId"/>
</apex:inputField> Decline Credit Check </apex:outputLabel>
I am trying to remove the text when the check box is checked. but whenever I try to check the box i get an error saying "Attempt to dereference a null object". Any hep in this ?