Rebuild Form Element with new property after Ajax I want to rebuild a Form Item with new property after Ajax triggered on page, I try following codes
&lt;?php

use Drupal\Core\Form\FormStateInterface;
use Symfony\Component\HttpFoundation\Request;

function MYMODULE_form_alter(&amp;$form, FormStateInterface $form_state, $form_id) {

    if ($form_id == 'node_trends_form' || $form_id == 'node_trends_edit_form') {
        $form['langcode']['widget'][0]['value']['#ajax'] = array(
            'callback' =&gt; 'MYMODULE_language_change',
             'wrapper' =&gt;'edit-field-trends-wrapper',
            'event' =&gt; 'change',

        );

        $form['field_trends']['widget'][0]['value']['#autocomplete_route_parameters'] = array('lang'=&gt;'test');
        $form['field_trends']['#prefix'] = '&lt;div id=&quot;edit-field-trends-wrapper&quot;&gt;';
        $form['field_trends']['#suffix'] = '&lt;/div&gt;';
    }

}

/**
 * Ajax callback.
 */

function MYMODULE_language_change(array $form, FormStateInterface $form_state) {
        $form_state-&gt;setRebuild(TRUE);
            $form['field_trends']['widget'][0]['value']['#title'] = &quot;New Title After Ajax&quot;;

        $form['field_trends']['widget'][0]['value']['#autocomplete_route_parameters'] = array('lang'=&gt;'onajax');
        return $form['field_trends'];
}

Update : in order to find the problem I change the code to simplest manner,

The Problem is  when ajax triggered  autocomplete replaced but changing on #autocomplete_route_parameters to applied !!!
Update 2 Strange things is I try to change field title on ajax callback handler it applied and after ajax new title is New Title After Ajax but  autocomplete parameters not changed. I confused
Finally I achieve it with following, Change autocomplete parameters prperty in form alter on rebuild event INSTEAD of changing property worked for me, 
        

    use Drupal\Core\Form\FormStateInterface;
    use Symfony\Component\HttpFoundation\Request;

    function zeytondev_form_alter(&amp;$form, FormStateInterface $form_state, $form_id) {

        if ($form_id == 'node_trends_form' || $form_id == 'node_trends_edit_form') {
            $form['langcode']['widget'][0]['value']['#ajax'] = array(
                'callback' =&gt; 'zeytondev_language_change',
                'wrapper' =&gt;'mtrend-wrapper',
                'event' =&gt; 'change',

            );

            //kint( $form['field_trends']);
            $form['field_trends']['#prefix'] = '&lt;div id="mtrend-wrapper"&gt;';
            $form['field_trends']['#suffix'] = '&lt;/div&gt;';
            $langcode = $form_state-&gt;getValue('langcode');
            if($langcode) {
                $langcode = $form_state-&gt;getValue('langcode');
                $langcode = $langcode[0]['value'];
            }
            else {
                $langcode = 'en';
            }
            //var_dump($langcode);
            $form['field_trends']['widget'][0]['value']['#autocomplete_route_parameters'] = array('lang'=&gt;$langcode);
        }

    }


    function zeytondev_language_change(array &amp;$form, FormStateInterface $form_state) {
        $form_state-&gt;setRebuild(TRUE);
        return ($form['field_trends']);
    }