Well I certainly am no expert on GWT, but I'm pretty good with it.
Lets see if I can help.

If I understand you correctly it sounds like you might be having some
trouble going from the standard way of giving a user a new page via a
new request to the server to a more Ajax approach.

You could give the user new pages via new get/post requests to the
server but then you would need a separate GWT project for each page.
Actually I think it would work to have multiple html files as starting
points for separate Modules and each Module would have its own
EntryPoint class with its onModuleLoad() method. Your web pages would
simply have links or w/e to each of the html files to load the
different GWT Modules.

Instead, taking a more Ajax approach to your app, I would build all
the pages in one GWT project (and one Module), each page being its own
class inheriting from some higher level container class that you want
to work with (ie. Composite or FlowPanel).  You could create your own
IPage interface to make all your "page" classes implement so that they
all have some sort of generate() method. This method is where you put
all the page specific GWT code to build the page how you want it. The
top level of your site might have a menu or other links from the site
or even just the action of being properly authenticated will call a
GWT method that exists higher up in your GWT app that "directs" the
site to a new "page". Your GWT code simply knows which page to go to
based on the event and instantiates the appropriate "page" class, sets
it as the widget inside a main placeholder and calls its generate()
method.

Something along those lines.

I haven't done a site like this yet, but I was thinking about this
same issue earlier today and I think that is how it's supposed to be
done. The only real problem with it is that it bloats your GWT
javascript and makes the first load of the site potentially large. Not
very large, because the only code adding to its size is the unique
code inside each generate() method. But I suppose that might be
considered like downloading all the html files of a static site at
once (well won't be that bad cuz obviously any site design is gonna be
around the placeholder).

So that extra size all in one download does indeed bother me. If the
site doesn't have too many pages with lots of unique content then it
might not be so bad, but for a large site this might be horrendous. I
do kinda like the idea of loading it all at the start so that the app
is super responsive, but this may not be realistic.

This is indeed problematic. Its too bad GWT doesn't include some sort
of self loader to load separate sections of its code upon need. You
should be able to create separate modules that get auto loaded upon
the first time they become needed.

Does anyone have a much wiser way of doing this?

On Jul 10, 4:03 pm, Bhayat <baki.hayat.c...@gmail.com> wrote:
> I have been trying about gwt tecnology for 2 weeks,and i try to create
> a web site but,i have some problems.this is start with trying to add
> new page to my application.for example i have a page that is created
> with full gwt and when user enter username and password ,according to
> these information user page or admin page will open but i have no idea
> about opening new pages("i am planing to create these pages with gwt")
> from my main application.
>
> i searched this topic but i cant understand because they are talking
> about multi paging or two separate modules or two entry points in only
> one project but i couldnt make comminication between these pages.
>
> so please give me idea.if you have any example code could you send me
> please to understand easily ??

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to Google-Web-Toolkit@googlegroups.com
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to