What is the correct way to check if a java object is not null in javascript?
Exampe:
private native  performIntern(JsArray<? extends Element> elements, int
duration, JavaScriptObject options,  HasOnComplete command) /*-{
                var func = null;
if (typeof  command !== 'undefined') {
func = function() {
comma...@com.bla.HasOnComplete::onComplete()();
}
}
return $wnd._CMod.perform(elements, duration, options,  func);
}-*/;

It will never enter the if if the command isn't null :(..
I also tried things like "if (command)" or first assign command to another
variable... but no luck and can't seem to find a matching example in code
some where. I noticed that GWT uses a global function "defined()" in for
example JavaScriptObject, but no idea where to find the source.
BTW: the if is entered if I do something like "if (duration > 0)"..... such
that the command is called...

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to