Skip to Main Content

DevOps, CI/CD and Automation

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Double click issue

Sirish ReddyApr 20 2022 — edited Apr 21 2022

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.

This post has been answered by John JB Brock-Oracle on Apr 21 2022
Jump to Answer

Comments

Post Details

Added on Apr 20 2022
2 comments
224 views