Hi,
I am new to GWT and in a learning phase.
Now while creating one example i am getting an exception for which i
would like to get someone's help from this forum.
Problem :
--------------
I created on textbox and a Button in GWT.
Now in action listener of button i am trying to invoke a javascript
function. This javascript function is in external .js file which i
have include in GWT.
But I am getting followin exception. I don't understand what it want
to say. I would be thankful if someone can help me figure out the
problem.
[ERROR] Uncaught exception escaped
com.google.gwt.core.client.JavaScriptException: (TypeError): Object
required
number: -2146827864
description: Object required
at com.selflearning.GWT.client.Dashboard.displayDatePicker(Native
Method)
at com.selflearning.GWT.client.Dashboard$1.onClick(Dashboard.java:
201)
at com.google.gwt.user.client.ui.ClickListenerCollection.fireClick
(ClickListenerCollection.java:34)
at com.google.gwt.user.client.ui.FocusWidget.onBrowserEvent
(FocusWidget.java:102)
at com.google.gwt.user.client.DOM.dispatchEventImpl(DOM.java:1308)
at com.google.gwt.user.client.DOM.dispatchEventAndCatch(DOM.java:
1287)
at com.google.gwt.user.client.DOM.dispatchEvent(DOM.java:1255)
My Code in Java File :
================
public void onModuleLoad()
{
Button date = new Button();
final TextBox displayDate = new TextBox();
displayDate.setName("ADate");
date.addClickListener(new ClickListener(){
public void onClick(Widget sender) {
String name =
DOM.getElementProperty(displayDate.getElement(),
"name");
Window.alert(name);
displayDatePicker(name,false,"dmy",".");
// sayHelloInJava("SV"); // This call
works without
exception.
}
});
}
// A Java method using JSNI
native void displayDatePicker(String name,boolean bol,String s1,
String s2) /*-{
$wnd.displayDatePicker(name,bol,s1,s2); // $wnd is a JSNI synonym
for 'window'
}-*/;
// A Java method using JSNI
native void sayHelloInJava(String name) /*-{
$wnd.sayHello(name); // $wnd is a JSNI synonym for 'window'
}-*/;
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google Web Toolkit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---