Getting item source input field in Autocomplete

Getting item source input field in Autocomplete

I'm using jQuery UI autocomplete in a similar way as described here:
The focus: sets the values of many fields. My problem is that I have an array of input fields, all with autcomplete. How do I detect the current input field being filled in, so I could find it's previous and next sibling?
For example:
  1. focus:
  2.       $(this).prev('.custom_field').val('Hello!');