Can someone explain the way that GWT deals with iframes in this
regard.
If I want to create my own widgets or for that matter, use other
widgets in an iframe.
The situation is that I have cached versions of arbitrary webpages
loaded into iframes (to get around the iframe domain problem)
and then I want my code to annotate these pages in some fashion,
ideally using floating GWT widgets.
I would expect to do something like this.
Document doc = iframe.getFrameDocument(); //wraps up the Document of
an iframe using managed iframe from gwt-ext for now but thinking of
doing this myself later and giving up on ext.
BodyElement body = doc.getBody();
Element div = DOM.createDiv();
body.appendChild(div);
div.setId("id123");
RootPanel panel = RootPanel.get("id123");
//or better would be RootPanel panel = RootPanel.get(div); //but this
is not a public method.
panel.add(firstWidgetOfMany)
But because RootPanel uses Document.get().getElementById(id).cast()
to find the element AND (shock horror) Document.get() assumes there is
only ever one document for a gwt application I don't understand how
one could tie up the elements in the frame to widgets in GWT without
completely rewriting RootPanel and possibly other classes.
I also want to ask what the potential pitfalls with this scenario are
and the GWT event model.
When I create widgets and parent/register them to existing widgets,
will the events that the elements raise find their way back to the GWT
widgets if the elements exist in the iframe?
Am I thinking about this incorrectly? Is it better to create a new
'instance' of GWT inside the iframe and then try and get the parent
and child instances talking together (i imagine this could also cause
problems)? Or is it simply not worth using GWT widget infrastructure
and build my own infrastructure based on DOM elements for this
scenario (a real pity)?
Thanx, Daniel.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---