Most of the page requests are in fact AJAX (page contains a lot of zone updates besides autocomplete events). So distinguishing by isXHR() doesn't help.
On Thu, May 15, 2014 at 6:39 PM, Michael Gentry <mgen...@masslight.net>wrote: > Hi Ilya, > > onActivate() gets called for both normal page render requests and AJAX/XHR > requests (used by the autocomplete). Have you tried: > > @Inject > private Request request; > > and calling the isXHR() method in request in your onActivate() to determine > if the request is normal or AJAX? > > onActivate() > { > if (request.isXHR()) // Do AJAX > { ... } > else // Do Normal > { ... } > } > > mrg > > > > On Thu, May 8, 2014 at 8:33 AM, Ilya Obshadko <ilya.obsha...@gmail.com > >wrote: > > > It turns out that running an event handler (onProvideCompletionsFromXXXX) > > in the same component/page may result in various race condition problems. > > > > Suppose you have a complex form and data initialization occurs during > > onActivate phase. Then, this initialization is going to happen every time > > onProvideCompletions handler is called. If this initialization involves > for > > example Hibernate objects loading, in several situations I get 'session > is > > closed' errors (in fact this is very unpredictable - the same operation > > under same conditions may either work normally or fail). > > > > Are there any suggested methods to make autocomplete data source totally > > independent from current component? > > > > -- > > Ilya Obshadko > > > -- Ilya Obshadko