jQuery autocomplete doesn’t work anymore after updating JSF components

  • When I change the drop-down and update any JSF components, then jQuery autocomplete does not work anymore. How is this caused and how can I solve it?

 

  • JSF CODE

<ace:selectMenu value=”#{MenuBean.cityList}” valueChangeListener=”#{MenuBean.ChCountry}”>
<f:selectItems itemValue=”cityList.id” itemLabel=”cityList_nm_city” />
</ace:selectMenu>

 

 

  •  jQuery autocomplete
  • $(document).ready(function() {
      $("#form\\:nm").autocomplete({
                    source : function(request, response) {
                              $.ajax({
                              url : url,
                              data : {method : "getnm",},
                       success : function(data) {
                                alert("success");
                               }
                       });
                  }
         });
    });

 

 

Solution:

I have found tow solution for this.
·Include one 1 function in jquery file,
o ice.onAfterUpdate(function name);
· <f:ajax render="yourComponent" onevent="loadAutocompleteField" />

 

Details:

· This problem is appear when changed any JSF compotes
o 1st solutions is write one line ice.onAfterUpdate , it’s calling every time when updating any jsf compotes
o Write inside auto compete field <f:ajax render="yourComponent" onevent="loadAutocompleteField" />