how to post data from one page to another

45 views
Skip to first unread message

Harnek Singh c

unread,
Dec 5, 2011, 12:47:53 AM12/5/11
to google-we...@googlegroups.com
Hello,
           i am new to gwt and i want to use this framework to
develop my new project,i studied basic tutorial on gwt and developed a
sample  application. i used history Mechanism for navigation,it is
working fine, now my issue is that how should i post data from one
page to another.i used formpanel but not sure what path should i set
in setAction() .and How to receive that posted data as i stay on the
same page with diffrent token.Or is there any another way to post data
while using History mechanism for page navigation.Please help me to
get out of issue asap.

Regards,
Harnek

-sowdri-

unread,
Dec 6, 2011, 12:13:33 AM12/6/11
to google-we...@googlegroups.com
>> .i used formpanel but not sure what path should i set in setAction() 

Do not use form panel, unless you are posting your data to a servlet/jsp that is external to the gwt module.  In this case you can also use RequestBuilder for accomplishing this. 

For changing pages within the module, use PlaceController.goTo(new MyNewPlace()); 

-sowdri-

Ed

unread,
Dec 6, 2011, 4:38:36 AM12/6/11
to Google Web Toolkit
It all depends how you will setup your pages and what you mean by
"pages".
The most obvious setup: the pages are part of the same GWT app.
In this case they can interchange data by sharing some class that
contains the value's you like to share. This class would be the so
called Data Model. This basically has nothing to do with GWT, it's a
general java setup.

In case the pages are separate, but are present under the same base
url, use:
- Cookies if it concerns little bit of data.
- session or local dom storage.
- RequestBuilder.

I can't tell you the correct solution due to lack of information. If
the new page is constructed on the server (the old fashion way), the
best way would be probably the RequestBuilder.
- Ed

On Dec 6, 6:13 am, -sowdri- <sow...@gmail.com> wrote:
> >> .i used formpanel but not sure what path should i set in setAction()
>
> Do not use form panel, unless you are posting your data to a servlet/jsp
> that is external to the gwt module.  In this case you can also use

> RequestBuilder<http://google-web-toolkit.googlecode.com/svn/javadoc/latest/index.htm...> for

Reply all
Reply to author
Forward
0 new messages