Drupal 8 Forms/Webforms Ajax Callback Elements I'm looking to add/edit elements on a Drupal 8 webform with Ajax Callbacks, I've read up on the buildForm technique, however my problem is a little more complicated, in that I am actually trying to do all of this inside of a custom composite element, not a form object.

Adding a new element via HtmlCommand is no problem, however any '#ajax' callbacks I add to this new element do not get initialised.

Thanks.
You can't add elements in an ajax callback:


  Note, that as part of the Form APIs security system, you cannot
  create new form elements in the callback function, as they will throw
  errors upon submission, and any #ajax on elements created in the
  callback will also not work. If you need to create new elements on
  ajax submit, they must be added in the form definition.


from https://www.drupal.org/docs/7/api/javascript-api/ajax-forms-in-drupal-7 (still valid for D8).

It should be possible to find a method in the composite element which is part of the form building process where you can add the form element.