I think the biggest problem you'll run into is that, when the history
changes, the URL token may be meant for either of the two modules.
You'll probably need to define a syntax for the history token that
includes separate places for each module's tokens. It's then up to
each module to only touch its own part of the token while preserving
the part(s) that it doesn't own.

Don't be tempted to simply put a flag in the token to indicate which
module the token is meant for. If the user uses a bookmark or backs up
by more than one page at a time, what does that mean about the state
of the other module(s)? Best to make sure the the token will always
contain appropriate state for both/all modules.

You should be able to put both parts in the same module by providing
two placeholders in your HTML with different IDs and target them using
RootPanel.get(id). You'll still have to make sure to include state for
both parts in your history token, but at least you'll only have one
module's history value change handler logic to worry about.

Finally, I've never actually tried to put together an application with
more than one module, so there may be issues other than history
management that you'll run into. Plus, there may be details of how the
plumbing works for delivering the history change events to a module
that would prevent this strategy from working at all; I don't have the
first-hane experience to predict that.

-Brian

On Nov 27, 8:39 am, Prashant <[email protected]> wrote:
> Hi,
>
> I want to user 2 or more GWT modules in a single page, each implementing its
> own (history)ValueChangeHandler. Is it not a good practice to use multiple
> modules in a single page? what issues I might face?
>
> Thanks.

--

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