On 10 Lip, 23:03, Bhayat <[email protected]> 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.

With GWT it's better not to think in terms of pages (html pages),
but panels or screens, i.e. in terms used in desktop applications.
Most of the time, your GWT application would be hosted in a single
page but the content of this page will change like a window of a
deskotop application.

So for example when the user logs into a desktop application, you
would
not send him to another application when he is admin user and
still another when he is noadmin user. You just show appropriate
panels/menus/widgets in the same window.

That's what you should do in GWT app. When you are back from
the server where your user was successfuly authenticated and
server returns the type of user all you have to do is show appropriate
part of the application.

Somewhere in the authentication callback:

if(authentication successful) {
   RootPanel.get(...).clear();
   if(user is admin)
      RootPanel.get(...).add(new AdminAppPanel());
   else
      RootPanel.get(...).add(new UserAppPanel());
}

But if you still want to load another page you can do it,
with native $doc.location= new page.

For example you can have three entry point modules in your
application, each with it's own html page.
In your Login.html/GWT app you can login the user and decide
which new page to load.

public native void loadModule(String url) /*-{
   $doc.location = url;
}-*/;

Somewhere in the Login.html/GWT app:

if(admin user)
   loadModule("Admin.html");  // load admin GWT module
else
   loadModule("User.html");  // load user GWT module

But here you must deal somehow with the communication between
Login and User/Admin modules.

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