Problem/Motivation

In code (references-dialog.js:) I see 'callback_path' option which could be added to field's JS settings but I can't find usages of it. Since there is any known for me "extension" for this module I think it isn't used yet anywhere and is not tested.

I'm working on "extension" to support select widgets of entityreference fields, and I need a way to re-render this widget with new list of widget (this should be done also on the server to update form's cache to not fall into validation errors on form submit). I tried to use this option but, since Drupal.ReferencesDialog.invokeCallback invokes just regular jQuery.post() method, any Drupal post-proccessing code (like commands and behaviors) is not called. So for now I have redeclared this method to replace html of the widget with new one, returned from server using this 'callback_path' mechanism.

Proposed resolution

I see some options to resolve this:

  • refactor Drupal.ReferencesDialog.invokeCallback method to enabled Drupal AJAX commands/behaviors
  • add some new API to enable custom js handlers after dialog is closed with new values

Comments

berdyshev created an issue.