Nuxeo / DAM / PAM / ECM specialistsContact

Nuxeo / Web UI

How to add custom logic to existing Nuxeo Web UI buttons

Let’s say you want to add some extra logic for the click event on a button. 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.

Talk to a Maretha Consultant

Tell us what you're struggling with, and we'll tell you how we can help you.

Talk to us
In this article

NUXEO Consultants - IMPLEMENTING BULK METADATA EDIT IN NUXEO, Maretha

How to add custom logic to existing Nuxeo Web UI buttons

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);

Read full article on Medium

Work with Maretha

Working through a content platform challenge?

Bring your platform, constraints and questions. Let us help you work through the approach.

Discuss your project ↗

← All insights