Re: GWT setHomePage

7 views
Skip to first unread message
Message has been deleted

Kara Rawson

unread,
May 11, 2010, 1:00:18 PM5/11/10
to streamhub-comet-...@googlegroups.com
couple things., this is the wrong disccusion group to as this, and second, you do not know how to code JSNI properly. Do a google search for GWT and JSNI and read the tutorial page, there are many gotcha's that you need to know about before implementing JSNI.

the reason your code doesn't work, is that all function or object references must start with $wnd. GWT replaces this with the proper refrence during compilation.

hence your code should be like


public static native String setHome()
      $wnd.document.body.style.behavior='url(#default#homepage)';
      $wnd.document.body.setHomePage('http://www.ebics.com/');
}-*/;



also any reason y you dont just use $wnd.location.href = 'http://www.google.com';

???

kara
 


On Mon, May 10, 2010 at 6:55 AM, jelmed <jelme...@gmail.com> wrote:
hi to all

I need to set an url into the navigator home page
i am using gwt 1.7
for doing this i am using a javascript function when i test it in html
it work fine

document.body.style.behavior='url(#default#homepage)';
document.body.setHomePage('http://www.ebics.com/');

but when i tray to create native gwt function like this

public static native String setHome() /*-{

               document.body.style.behavior='url(#default#homepage)';
               document.body.setHomePage('http://www.ebics.com/');

       }-*/;

it not be work i obtained
com.google.gwt.core.client.JavaScriptException: (Error): Permission
refusée
 number: -2146828218
 description: Permission refusée

How i can resolve it
Thanks.

--
You received this message because you are subscribed to the Google Groups "StreamHub Comet Server Community" group.
To post to this group, send an email to streamhub-comet-...@googlegroups.com.
To unsubscribe from this group, send email to streamhub-comet-server...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/streamhub-comet-server-community?hl=en-GB.


--
You received this message because you are subscribed to the Google Groups "StreamHub Comet Server Community" group.
To post to this group, send an email to streamhub-comet-...@googlegroups.com.
To unsubscribe from this group, send email to streamhub-comet-server...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/streamhub-comet-server-community?hl=en-GB.
Reply all
Reply to author
Forward
0 new messages