Skip to content

Commit

Permalink
Merge pull request #4139 from SalesforceFoundation/feature/prince-bge…
Browse files Browse the repository at this point in the history
…-multiple-save-clicks-bug

BGE: Prevent multiple save clicks on entry form
  • Loading branch information
ptewson-sfdo authored Mar 25, 2019
2 parents 204df5d + 9d5b692 commit 5edc592
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/aura/BGE_EntryForm/BGE_EntryForm.cmp
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@
objectApiName="{!v.labels.dataImportObject}"
onsuccess="{!c.onSuccess}"
onsubmit="{!c.onSubmit}"
onload="{!c.onFormLoad}">
onload="{!c.onFormLoad}"
onerror="{!c.onError}">
<lightning:messages />

<lightning:layout multipleRows="true">
Expand Down
10 changes: 8 additions & 2 deletions src/aura/BGE_EntryForm/BGE_EntryFormController.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,15 @@
component.find('recordEditForm').submit(completeRow);
} else if (validity.missingFields.length !== 0) {
helper.sendErrorToast(component, validity.missingFields);
} else {
//do nothing since data format errors display inline
// Allow users to attempt another save
component.set('v.pendingSave', false);
}
},

/**
* @description: reenable save button when there's an inline error
*/
onError: function (component, event, helper) {
component.set('v.pendingSave', false);
},

Expand Down

0 comments on commit 5edc592

Please sign in to comment.