Forward to another page (newbie question)

154 views
Skip to first unread message

Payam

unread,
Dec 13, 2007, 10:23:07 AM12/13/07
to Google Web Toolkit
Hi all,

I am fairly new to GWT. Here is where I am right now. I created a
brand new GWT project from scratch, called Test. Inside my
onModuleLoad() function, I am creating some widgets. I want the
onClick of one of my buttons to redirect to forward to another page
carrying some session data (basically whatever is selected or typed in
the widgets of the first page needs to be carried over for editing on
the next page).

Not sure how I can go about to create the new page. I have created
another Java class that implements EntryPoint for the new page and
have defined my screen inside the onModuleLoad of it. Do I need to
have an html page for this or will the GWT create this for me? For
Test.java, the application creator created Test.html for me.

Also, my second question is "how can I forward to this new page upon a
button click?"

Thanks in advance,
Payam

Chad Bourque

unread,
Dec 13, 2007, 10:30:18 AM12/13/07
to Google-We...@googlegroups.com
Payam,

You need to change the way you think about "pages." In GWT, pages can be reduced to panels. Then, to change pages, you simply remove (or hide) one panel and add (or show) your next panel. So, move the widgets from your first page into a panel and add that panel instead of the widgets individually. Do the same thing for your second page. Then, in the click event handler, just show the second panel. You may consider using a DeckPanel. Then, you can simply change panels.

HTH,
Chad

On Dec 13, 2007 9:23 AM, Payam <payam...@gmail.com> wrote:

Hi all,

I am fairly new to GWT. Here is where I am right now. I created a
brand new GWT project from scratch, called Test. Inside my
onModuleLoad() function, I am creating some widgets. I want the
onClick of one of my buttons to redirect to forward to another page
carrying some session data (basically whatever is selected or typed in
the widgets of the first page needs to be carried over for editing on
the next page).

Not sure how I can go about to create the new page. I have created
another Java class that implements EntryPoint for the new page and
have defined my screen inside the onModuleLoad of it. Do I need to
have an html page for this or will the GWT create this for me? For
Test.java , the application creator created Test.html for me.


Also, my second question is "how can I forward to this new page upon a
button click?"

Thanks in advance,
Payam

 * Those who need closure

Payam

unread,
Dec 13, 2007, 3:30:53 PM12/13/07
to Google Web Toolkit
Thanks. Got it.

Best,
Payam

On Dec 13, 10:30 am, "Chad Bourque" <chad...@gmail.com> wrote:
> Payam,
>
> You need to change the way you think about "pages." In GWT, pages can be
> reduced to panels. Then, to change pages, you simply remove (or hide) one
> panel and add (or show) your next panel. So, move the widgets from your
> first page into a panel and add that panel instead of the widgets
> individually. Do the same thing for your second page. Then, in the click
> event handler, just show the second panel. You may consider using a
> DeckPanel. Then, you can simply change panels.
>
> HTH,
> Chad
>
> On Dec 13, 2007 9:23 AM, Payam <payam.f...@gmail.com> wrote:
>
>
>
>
>
>
>
> > Hi all,
>
> > I am fairly new to GWT. Here is where I am right now. I created a
> > brand new GWT project from scratch, called Test. Inside my
> > onModuleLoad() function, I am creating some widgets. I want the
> > onClick of one of my buttons to redirect to forward to another page
> > carrying some session data (basically whatever is selected or typed in
> > the widgets of the first page needs to be carried over for editing on
> > the next page).
>
> > Not sure how I can go about to create the new page. I have created
> > another Java class that implements EntryPoint for the new page and
> > have defined my screen inside the onModuleLoad of it. Do I need to
> > have an html page for this or will the GWT create this for me? For
> > Test.java, the application creator created Test.html for me.
>
> > Also, my second question is "how can I forward to this new page upon a
> > button click?"
>
> > Thanks in advance,
> > Payam
>
> --
> There are two types of people in the world:
> * Those who need closure- Hide quoted text -
>
> - Show quoted text -
Reply all
Reply to author
Forward
0 new messages