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