How do I fix so AutoComplete work in JQuery-UI dialog

How do I fix so AutoComplete work in JQuery-UI dialog

I have seen that there are other that have had the same problem.
I open my JQuery dialog like this

  function Click_NewVoyage()
       {
           //Create and display dialog dlgNewVoyage
           $("#dlgNewVoyage").dialog({
               width: 900
           });
...
}

How should I write to get autocomplete to work ?

//Tony