Hello all, Is there an elegant and standard way within JET framework to prevent user from double clicking on the button?
<oj-button id='submit' on-oj-action='[[submitRequest]]'>Submit</oj-button>
I have tried the following but it doesn't work... It still gets submitted twice.
Being a Java developer, any help on resolving this OJET issue would be highly appreciated.
self.requestInProgress = ko.observable(false);
self.submitRequest = async function (event) {
console.log('createRequest::submitRequest');
console.log('self.requestInProgress::'+self.requestInProgress());
await executeSubmitCall();
};
var executeSubmitCall = async function () {
if (!self.requestInProgress()) {
self.requestInProgress(true);
if (await validateSubmitForm()) {
await prepareSubmitCall(false);
}
self.requestInProgress(false);
}
};
Thanks.