

The first problem is that there are already some functions attached to the click event of the button. Adding a new event, does not guarantee it will run first.
1. removeEventListener() does not help, as we don't have access to the function pointer to be removed.
2. cloneNode() you can clone your button, hide it and replace it with the cloneButton adding a custom logic in the cloneButton click event function, but the original button is not static, it has fields and styles updated by Polymer (and we need them).
const node = document.getElementById("demo"); const clone = node.cloneNode(true); document.body.appendChild(clone);
Keep reading
This is a solution for successfully overwriting Nuxeo LTS2021 Web UI bundled JS components without getting the error Uncaught DOMException: Failed to execute ‘define’ on ‘CustomElementRegistry’: this name has already been used with this registry.
Read articleUnbundled (original) Nuxeo LTS2021 Web UI JavaScript components are defined in JS files ready to be bundled with Webpack into the Nuxeo Web UI JS bundles. They have “import” statements which bring in the necessary components & behaviors.
Read articleAI workflows are only as good as the context you give them. Here’s how to add a description (or any) field to your Nuxeo vocabularies, with XSD, XML and UI examples.
Read articleTell us what you're struggling with, and we'll tell you how we can help you.
Talk to us