title: How to get selected item from AUI autocomplete list
body: <p>I want to show address in my database to an autocomplete aui input field.Everything seems working fine.But im not able to retrive the address number of the record.How to use the on change event of autocomple-list or how can i access the selected item's json object</p>
  
  <pre><code>  @Override
          public void serveResource( ResourceRequest resourceRequest, ResourceResponse resourceResponse ) throws IOException,
                  PortletException
          {
  
  
              String cmd = ParamUtil.getString(resourceRequest, "get_address");
              String myInputNode = ParamUtil.getString(resourceRequest, "addressAutocomplete");
  
              System.out.println("addressAutocomplete"+myInputNode);
              if (cmd.equals("get_address")) {
               getUsers(resourceRequest, resourceResponse,myInputNode);
              }
              }
  
  
      private void getUsers(ResourceRequest resourceRequest, ResourceResponse resourceResponse, String myInputNode) throws IOException, PortletException {
  
                  JSONArray usersJSONArray = JSONFactoryUtil.createJSONArray();
                  ThemeDisplay themeDisplay =    (ThemeDisplay)resourceRequest.getAttribute(WebKeys.THEME_DISPLAY);
                  JSONObject userJSON=null;
                  try {
                  List&lt;AddressMaster&gt; userList=AddressMasterLocalServiceUtil.getAllAddressBySearchKey( myInputNode );
                                             for(AddressMaster addressMaster:userList){
                  userJSON=JSONFactoryUtil.createJSONObject();
                  userJSON.put("addressNumber",addressMaster.getAdrNummer());
  
                  userJSON.put( "address",  addressMaster.getAddress())
           );
  
                         usersJSONArray.put(userJSON);
                  }
                  } catch (Exception e) {
                  }
                  PrintWriter out=resourceResponse.getWriter();
                  out.println(usersJSONArray.toString());
  
                  System.out.println("usersJSONArray"+usersJSONArray.toString());
  
  
  
              }
  </code></pre>
  
  <p>Jsp File</p>
  
  <pre><code>&lt;portlet:resourceURL var="getAddress"&gt;
     &lt;portlet:param name="get_address" value="get_address" /&gt;
   &lt;/portlet:resourceURL&gt;
  
  
   &lt;aui:input id="addressAutocomplete"  name="addressAutocomplete" label="group_choose_address"   style="width:700px"/&gt;
  
  &lt;aui:script&gt;
  AUI().use('autocomplete-list','aui-base','aui-io-request','autocomplete-filters','autocomplete-highlighters',function (A) {
  A.io.request('&lt;%=getAddress%&gt;',{
  dataType: 'json',
  method: 'GET',
  on: {
  success: function() {
  //continents=this.get('responseData');
  //alert(continents[0].name);
  new A.AutoCompleteList(
  {
  allowBrowserAutocomplete: 'true',
  activateFirstItem: 'true',
  inputNode: '#&lt;portlet:namespace/&gt;addressAutocomplete',
  resultTextLocator: 'address',
  resultHighlighter:['phraseMatch'],
  resultFilters:['phraseMatch'],
  render: 'true',
  source:this.get('responseData'),
  });
  }}
  });                  
  });
  &lt;/aui:script&gt;
  </code></pre>