Arun is right with his approach, but it could be needed to change a little thing. I tested it with DWR-3.0.0-RC2, jquery-1.7.2.min.js and jquery-ui-1.8.23.custom.min.js.
Instead of:
$('#autoCompTxt').autocomplete(data) ;
define the source parameter:
$('#autoCompTxt').autocomplete({source:data});
Moreover that good answer can be slightly improved checking the autoCompTxt length. Something like this:
$(function() {
$('#autoCompTxt').keyup(function() {
var val = $('#autoCompTxt').val();
if(val.length>2) { // check length
TestService.ajaxAutoCompleteTest(val, function(data) {
// handle successful DWR response
$('#autoCompTxt').autocomplete({source:data});
});
} else {
$('#autoCompTxt').autocomplete({source:[]}); // clean
}
});
});
Of course, script and css imports and input text should be kept (see Arun's answer).