How to add and configure a link to custom properties provider

Hi,

I want to add a link to a custom properties panel tab, trying to do this I realize that is not the same like adding a textbox or selectbox

entries: [
              EntryFactory.link({
                id: 'custom',
                label: this.translate('customText'),
                modelProperty: 'customText',
                handleClick: 'Text',
                showLink: 'text'
              }),
            ]

It doesn´t work this way because

showLink and handleClick must be a function

but I don´t know how (actually where) implement this functions.

Thanks in advance for you help.

You can implement these functions anywhere.

EntryFactory.link({
  id: 'custom',
  label: this.translate('customText'),
  modelProperty: 'customText',
  handleClick: function() {
    // Handle click
    console.log('Click');
  },
  showLink: function() {
    // Return true or false
    return true;
  }
}),

Thanks a lot for your answer, that’s what I was looking for.

I have another question, Can I catch the click event from the eventBus?.
Can I add the handleClick function into that bus?

I’m already getting the click event for elements inside the diagram with this code inside a controller this way:

let eventBus = this.modeler.get('eventBus');
        eventBus.on('element.click', event => {
                console.log(event.element);
}

How can I do the same with a properties panel element?

Can you explain what you’re trying to do? High-level?

Sure, I´m trying to display a dialog when a user click on the properties panel link added in a custom tab.

This dialog is in a controller where the bpmn implementation is, so I need to know in the controller when a click is made in this link.

Maybe there is another way, I’m asking about eventBus because this way I’m catching another events inside the diagram, but maybe what I need is something else.

Thanks in advance

1 Like