On 22 mar, 20:51, DanG <[email protected]> wrote:
> public native Document getFrameDocument()/*-{
> var panel =
> [email protected]::getOrCreateJsObj()();
> var doc = panel.getFrameDocument();
> //alert(doc);
> if (doc)
> return doc;
> return null;
> }-*/;
>
> if in my native javascript code (using a 3rd party library, i'm
> wrapping ManagedIFrame extension) I get back an object HTMLDocument.
> Can I just return this to a com.google.gwt.dom.client.Document? no
> type conversion needed?
Right.
(actually, you could return any javascript object --anything that's
not a String, Number or Boolean--, it would work... until you try to
call a method or access a field, that would most likely not exist on
the given object).
> well it doesn't seem to work and not sure how
> to proceed for debugging this.
>
> The commented out alert tells me me I have a [object HTMLDocument]
>
> but when I try to call methods (i.e. getNodeValue) on the returned
> document the debugger tells me (in eclipse)
> 'Method "getNodeValue" with signature "()Ljava/lang/String;" is not
> applicable on this object'
Evaluating things from the debugger just doesn't work for
JavaScriptObject's (or any "native"/JSNI method), it's a known issue
that won't be fixed anytime soon:
http://code.google.com/p/google-web-toolkit/issues/detail?id=2912
> How do I turn this HTMLDocument into a working Document? Obviously
> something I'm missing because I'm not familiar with this technology or
> the library in question.
Your code is OK, you just cannot use the debugger facilities...
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---