You need to sign in to do that
Don't have an account?
VF re-render randomly creates error
A VF page has a command button that adds a new object record to a list and then re-renders the VF page which displays the list via an <apex;repeat> component. Everything works as expected though randomly the page re-render (button submission) fails and the 'Generic Error Page' page is displayed. The debug log doesn't show any errors. The only thing I can think of is possible the setter methods are randomly not running correctly before the page re-renders. Possibly due to javascript onComplete?
Button:
<apex:commandButton styleClass="btn" action="{!addDisbursmentEntry}" value="Add another student" reRender="frm" onComplete="toBottom()" disabled = "{!numberOfDisbursments > 9 || YearEndReportSubmitted || readOnlyUser}" />
Related Method:
public void addDisbursmentEntry()
{
Transactions__c transHolder = new Transactions__c(
School__c = accountHolder.id,
Year_End_Report__c = yearEndReport.id,
Transaction_Type__c = 'Disbursement'
);
disbursmentList.add(transHolder);
}
The page re-render is for the the '<apex:form> component which contains the repeat component:
<apex:repeat value="{!disbursmentList}" var="disbursment">
Javascript called:
<script>
function toBottom()
{
window.scrollTo(0, document.body.scrollHeight);
}
</script>
Thanks!!