public function PaymentReferenceBase::ajaxRefresh in Payment 8.2
Implements form AJAX callback.
File
- src/
Element/ PaymentReferenceBase.php, line 516
Class
- PaymentReferenceBase
- Provides a base for payment reference elements.
Namespace
Drupal\payment\ElementCode
public function ajaxRefresh(array &$form, FormStateInterface $form_state) {
$triggering_element = $form_state
->getTriggeringElement();
$root_element_parents = array_slice($triggering_element['#array_parents'], 0, -2);
$root_element = NestedArray::getValue($form, $root_element_parents);
$response = new AjaxResponse();
$response
->addCommand(new ReplaceCommand('#' . $root_element['container']['#id'], $this->renderer
->render($root_element['container'])));
return $response;
}