Implementing a custom table.addElement()

Hello, I am attempting to make a basic custom table property in the Properties Panel but I am running into one specific error when implementing the addElement() function. I would like some help solving this error and seeing where I went wrong. First let me say what I have tried so far.

There is no documentation on how to implement the addElement() function for the table prop; so I have used the camunda properties implementation that you mentioned in a previous forum to get an idea of how to implement the addElement() function.

From what I can tell after looking at the camunda properties implementation and reading the forums, I have gathered that the addElement() function is supposed to return an array of commands, then these commands will be pushed to the commandStack. And from what I gathered the main steps to create a command are as follows:

  1. Use the ElementHelper.createElement() method to create the element you would like to add to the table.
  2. Use the CmdHelper.addElementsTolist() method to create a command
  3. add the command you made in the previous step to an array
  4. return that commands array.

I have attempted to follow these steps so I can add elements to my table. However I don’t quite understand all the parameters that the methods ElementHelper.createElement() and CmdHelper.addElementsTolist() require. I have looked at each methods source file and I have implemented these methods to the best of my ability. However I still am getting the following error every time I click the addElement Button.

image

My suspicions are that I am passing something into the CmdHelper.addElementsTolist() function that I’m not supposed to, yet I cannot figure out what it is. I have created a CodeSandBox that recreates my problem.

The table property I am attempting to create is a property of the task objects so you will have to navigate to a task, then the “Task Steps” tab, then add an element to trigger this error.

If you need any additional info or context I’d be happy to provide.

Thanks in advance.