How to use ajax in field widget form?
You need to specify the class (including the full namespace) to run that method on. E.g: 'callback' =&gt; \Drupal\my_module\Plugin\Field\FieldWidget\MyWidget::changeCountry