Autocomplete works with labels, and in order to retrive the id of the selected label i added a
hidden field into the form and used select event to set the id in that field.
$autocomplete = new ZendX_JQuery_Form_Element_AutoComplete('autocomplete');
$autocomplete->setLabel( 'autoLabel' )
->setJQueryParam("source", 'http://host/controller/autocomplete')
->setJQueryParams(array("select" => new Zend_Json_Expr(
'function(event,ui) { $("#autoid").val(ui.item.id) }')
));
echo $autocomplete;
The source url should return a json encoded array formed from elements that have ‘value’ and ‘id’ properties.
Thanks very much !!!
was just what I was looking for !