On the visual force page I have a method that is being called by clicking on the command link as follows
<apex:actionRegion>
<apex:input type="date" value="{!recurringTaskLPP.endDate}">
</apex:input>
<apex:commandLink action="{!calculateEndDate}" value="Calculate End Date"
reRender="RecurringDatesSection">
</apex:commandLink>
</apex:actionRegion>
After clicking the command link I have the following method being called on in the controller
public void calculateEndDate() {
PageReference pageError = this.checkForErrors();
if (recurringTaskLPP.getFrequency() == FREQUENCY_TYPE_DAILY) {
this.calculateEndDateForDailyView();
}
if (recurringTaskLPP.getFrequency() == FREQUENCY_TYPE_WEEKLY) {
this.calculateEndDateForWeeklyView();
}
if (recurringTaskLPP.getFrequency() == FREQUENCY_TYPE_MONTHLY) {
this.calculateEndDateForMonthlyView();
}
}
public PageReference checkForErrors(){
if (recurringTaskLPP.recurringAmount == null || recurringTaskLPP.startDate == null || recurringTaskLPP.numberOfLppDetails == null) {
ApexPages.Message recurringTaskErrorMessage = new ApexPages.Message(ApexPages.Severity.WARNING, 'Amount field and Start Date and Lpp Details Count should not be left empty!');
ApexPages.addMessage(recurringTaskErrorMessage);
}
return null;
}
But the error message never displays and it gives an error that you are trying to De-reference the null object. Can some one please help me in understanding why the error is not displayed and how cna it be resolved.