In my logs I could see that method that was triggered by the triggerEvent() was still running when onSuccess event was handled. So I got the impression that triggerEvent method is not blocking...but if it is then my problem is somewhere else I guess, right?
On Sun, Jul 13, 2014 at 7:02 PM, Dmitry Gusev <dmitry.gu...@gmail.com> wrote: > Hi Boris, > > resources.triggerEvent() is a blocking operation, so all callbacks will be > invoked during this call. > > Hence it's not clear what you mean by saying "refresh is faster then > processing of the event". > > Can you tell us who is calling the triggerEvent method? > > And what are you trying to do by using the callback? > > > On Sat, Jul 12, 2014 at 2:20 PM, Boris Horvat <horvat.z.bo...@gmail.com> > wrote: > > > Hi everyone, > > > > I have a component that triggers the event, once the event is triggered, > it > > will go to OnSuccess method that will try to refresh the zone as you can > > see below > > > > private CaptureResultCallback<String> triggerEvent(Object value, > Object[] > > context) { > > CaptureResultCallback<String> callback = new > > CaptureResultCallback<String>(); > > List<Object> eventContext = new ArrayList<Object>(); > > if (context != null) { > > eventContext.addAll(Arrays.asList(context)); > > } > > eventContext.add(value); > > this.resources.triggerEvent(UPDATE_EVENT, eventContext.toArray(), > > callback); > > return callback; > > } > > > > Object onSuccess() {\ > > return request.isXHR() ? zoneFlowEdit.getBody() : null; > > } > > > > However it can happen that this refresh it faster then processing of the > > event on the other side, so when the zone tries to refresh itself it > doesnt > > have all of the information that it needs and it throws NPE. > > > > Is it possible to force the wait here so that I wait for the return of > the > > callback and then proceed to the onSuccess method? > > > > Thanks > > > > -- > > Sincerely > > *Boris Horvat* > > > > > > -- > Dmitry Gusev > > AnjLab Team > http://anjlab.com > -- Sincerely *Boris Horvat*