On 30 oct, 01:15, Raziel <[email protected]> wrote:
> Hi, I have a legacy application and thus I'm migrating to GWT by
> reimplementing parts of it at a time. However, one of this "parts" may
> appear in a document more than once, displaying different information.
>
> Aside from ensuring that if I generate IDs for a widget these must be
> namespaced according to the application's instance that created it (in
> case I retrieve them by ID somewhere), are there any other precautions
> that I should take to avoid collisions between application instances?
> For example, since the GWT application is put inside an iframe whose
> id is the name of the application's module, shouldn't it be necessary
> to generate the iframes with different ids? Otherwise we'll end up
> with elements (the iframes) with the same ID.

If you included the very same JS script, why would it run differently
than the previous one? I mean, you use RootPanel.get(XXX) or
Document.get().getElementById(XXX) somewhere in your app; and XXX
cannot be different for 2 "instances" of the same app in the page
(it's either hard-coded or taken from the same Dictionnary –whose name
is hard-coded– or the URL), right?

If you want your app to appear more than once, in different
"containers" of the same page, you'd have to use a Dictionnary or
similar to pass the containers' IDs to the app, and the app loops
through the list to instantiate as many "root components" as
necessary.
See 
http://groups.google.com/group/Google-Web-Toolkit-Contributors/browse_thread/thread/f8a0f35b4b9efcb2
and http://code.google.com/p/google-web-toolkit/issues/detail?id=2592

Or am I misunderstanding you?
--~--~---------~--~----~------------~-------~--~----~
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