PDA

View Full Version : onPreviewNativeEvent bug?



anton_ds
28 Aug 2009, 6:43 AM
Hello forum Members and GXT Developers Team.

I need to replace Browser Context menu with my own GXT Menu in all application, on all controls except Field Childs. on Field's parented controls I need standart browser menu.

Now i'm trying to use add NativePreviewHandler interface like in code below:



CChangePassword extends Window implements NativePreviewHandler {
...............................
public CChangePassword() {
setModal(true);
Event.addNativePreviewHandler(this);
}
...............................
@Override
public void onPreviewNativeEvent(NativePreviewEvent event) {
System.out.println(event.getTypeInt());

}


It's work fine on Layouts and content panels but on ModalWindow i'm getting a Error:


00:17:33,685 [ERROR] Uncaught exception escaped java.lang.NullPointerException: null at kz.csd.journal.commons.client.CChangePassword$2.handleEvent(CChangePassword.java:80) at kz.csd.journal.commons.client.CChangePassword$2.handleEvent(CChangePassword.java:1) at com.extjs.gxt.ui.client.event.BaseObservable.callListener(BaseObservable.java:176) at com.extjs.gxt.ui.client.event.BaseObservable.fireEvent(BaseObservable.java:96) at com.extjs.gxt.ui.client.widget.Component.fireEvent(Component.java:444) at com.extjs.gxt.ui.client.widget.form.Field.onBlur(Field.java:1048) at com.extjs.gxt.ui.client.widget.form.TextField.onBlur(TextField.java:405) at com.extjs.gxt.ui.client.widget.form.Field.onComponentEvent(Field.java:600) at com.extjs.gxt.ui.client.widget.Component.onBrowserEvent(Component.java:760) at com.google.gwt.user.client.DOM.dispatchEventImpl(DOM.java:1322) at com.google.gwt.user.client.DOM.dispatchEventAndCatch(DOM.java:1305) at com.google.gwt.user.client.DOM.dispatchEvent(DOM.java:1266) at sun.reflect.GeneratedMethodAccessor38.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103) at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:67) at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:146) at com.google.gwt.dev.shell.BrowserChannel.reactToMessages(BrowserChannel.java:1235) at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:153) at java.lang.Thread.run(Unknown Source)

this code gave same error..


@Override
public void onBrowserEvent(Event event) {
System.out.println("df");
}


Can anyone help me with it?

P.S. My attributes:
GWT build is 2.0
GXT is 2.0.1
Platform is Windows XP SP3
Hosted Browser is FireFox with OOPHM

sven
28 Aug 2009, 7:22 AM
Moving this to the help forum as that is the correct palce. This is not a bug in GXT

sven
28 Aug 2009, 7:26 AM
Try to post a full working testcase of what you are trying to do. Probably someone can help you with that