You are here

public function EntityForm::updateFormElements in Entity Browser 8.2

Same name and namespace in other branches
  1. 8 modules/entity_form/src/Plugin/EntityBrowser/Widget/EntityForm.php \Drupal\entity_browser_entity_form\Plugin\EntityBrowser\Widget\EntityForm::updateFormElements()

AJAX callback to update the two form elements: bundle and form_mode.

File

modules/entity_form/src/Plugin/EntityBrowser/Widget/EntityForm.php, line 226

Class

EntityForm
Provides entity form widget.

Namespace

Drupal\entity_browser_entity_form\Plugin\EntityBrowser\Widget

Code

public function updateFormElements($form, FormStateInterface $form_state) {
  $response = new AjaxResponse();
  $response
    ->addCommand(new ReplaceCommand('#bundle-wrapper-' . $this
    ->uuid(), $this
    ->updateBundle($form, $form_state)));
  $response
    ->addCommand(new ReplaceCommand('#form-mode-wrapper-' . $this
    ->uuid(), $this
    ->updateFormMode($form, $form_state)));
  return $response;
}