There are few things you can do without using location.reload
if you just want to fetch the data back from server.
You can fetch the data from server again and update the UI after submit
operation is success.
You can recall doInit
method, so if your doInit
is fetching the data again it would do the same.
For eg:
If you are calling server side from init
({
init: function (cmp, event, helper) {
helper.fetchDataFromServer(cmp, event, helper);
},
});
({
fetchDataFromServer : function (cmp, event, helper) {
let findContacts = cmp.get('c.fetchContact');
findContacts.setCallback(this, function (response) {
// Your action
});
$A.enqueueAction(findContacts);
}
});
Then in handleSubmit
method just recall server again.
handleSubmit: function (cmp, event, helper) {
// Do your stuff
helper.fetchDataFromServer(cmp, event, helper);
}