public void onPreviewNativeEvent(final NativePreviewEvent
nativePreviewEvent) {
final NativeEvent nativeEvent =
nativePreviewEvent.getNativeEvent();
DeferredCommand.addCommand(new Command() {
public void execute() {
System.out.println(nativeEvent.getType());
}
});
It spits out an error at nativeEvent.getType() which is as follows:
[ERROR] Uncaught exception escaped
com.google.gwt.core.client.JavaScriptException: (Error): Member not
found.
number: -2147352573
description: Member not found.
at com.google.gwt.dom.client.DOMImpl.eventGetType(Native Method)
at com.google.gwt.dom.client.NativeEvent$.getType$(NativeEvent.java:
209)
at com.christiedigital.widgets.core.popup.BasePopupPanel$1.execute
(BasePopupPanel.java:83)
at com.google.gwt.user.client.CommandExecutor.doExecuteCommands
(CommandExecutor.java:310)
at com.google.gwt.user.client.CommandExecutor$2.run
(CommandExecutor.java:205)
at com.google.gwt.user.client.Timer.fireImpl(Timer.java:160)
at com.google.gwt.user.client.Timer.fireAndCatch(Timer.java:146)
at com.google.gwt.user.client.Timer.fire(Timer.java:138)
Any insights?
The events cannot be used "async"; you must retrieve all the
properties upfront before doing your DeferredCommand:
public void onPreviewNativeEvent(NativePreviewEvent
nativePreviewEvent) {
NativeEvent nativeEvent =
nativePreviewEvent.getNativeEvent();
final String eventType = nativeEvent.getType();
DeferredCommand.addCommand(new Command() {
public void execute() {
System.out.println(eventType);
}
});
Thanks for your response. The only reason I have the DeferredCommand
in there is to actually spit this out. If I don't defer it, my
application simply freezes as its spiting out this error as I move my
mouse around. So essentially I don't even see the println since this
preview occurs and crashes. My point is that the error still occurs
regardless.
Any other thoughts?
Thanks
> });- Hide quoted text -
>
> - Show quoted text -