Monday, February 6, 2012

Re: changing pages in GWT

On 04/02/2012 12:19, nofear wrote:
> I have a log in page which asks username and password to log in for
> students or teachers. After confirmation the informations of students
> or teachers, i would like to redirect user to his proper page (i mean
> change the log-in page to his proper page) , basicly i didn't
> understand how can i do that after clicking the "CONFIRM" button.

I am myself a beginner, although I "play" with GWT for some months already (doing proof of
concept, prototypes, etc., exploring the capabilities). So I hope I won't be misleading.

My understanding is that in GWT, you don't really have the concept of "pages" like you do
in classical Web sites / applications.
Everything happens at the same URL, in the same page, mostly empty: it is filled by
JavaScript, using Ajax to fetch the data and which components to display.

So, once the login is validated, you have to fill this page with the main UI: something like
RootPanel.get().clear();
RootPanel.get().add(new MainUI());
(or with RootLayoutPanel, of course).

An alternative is to use the MVP pattern (with a library like GWT-Platform, MVP4G, the
official Google support, or similar) which manages the concept of pages for you.

--
Philippe Lhoste
-- (near) Paris -- France
-- http://Phi.Lho.free.fr
-- -- -- -- -- -- -- -- -- -- -- -- -- --

--
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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

No comments:

Post a Comment