On 8 oct, 13:30, devries <[EMAIL PROTECTED]> wrote:
> Hello!
> I'm trying to add widget from iGoogle catalog to my application. It
> should be possible when I place code generated 
> byhttp://www.gmodules.com/ig/creator
> on my web. So I create object HTML and put this code using setHTML.
> The code is shown, but gadget isn't loaded. Why doesn't it work?

Browsers don't evaluate scripts injected with innerHTML (which is used
by setHTML())

> Do you have any ideas how can solve such problem?

I'm not sure but you might have to paste the code within your HTML
host page (say within a DIV with an assigned ID) and then use GWT to
detach/reattach the element where you want it to appear; because the
script probably uses document.write() to "inject" the gadget.

To do that, you'd better create some kind of Gadget widget and use
Document.get().getElementById(...) to retrieve the container DIV and
pass it as the Gadget's element.

(untested)

class Gadget extends Widget {
   public static Gadget createFrom(String containerId) {
      Element container = Document.get().getElementById(containerId);
      container.getParentNode().removeChild(container);
      return new Gadget(container);
   }

   private Gadget(Element container) {
      setElement(container);
   }
}


--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to