Open url with POST parameters

3,015 views
Skip to first unread message

Cesc

unread,
Nov 12, 2008, 6:34:38 AM11/12/08
to Google Web Toolkit
Hi all,
I've searching all around the discussions and although there were a
few hints, I couoldn't find a suitable solution.

In HTML, I have a form like:

--------------
<form name="retrieve" method="POST"action="http://action_script">
<input type="submit" value="submit">

<table >
<tR>
<td align=center><div style="padding: 1px 1px 1px 1px; background-
color: rgb(0,255,0); border: solid black 1px;"><input name="dataset"
type="checkbox" value="datasetID"></div></td><td>Dataset</td></tr>
</table>
</form>
----------------

When I click on submit, a new url is opened and process the datasetID
accordingly, for example, a new html page displaying: "You have
selected datasetID="...." ".

I want to reproduce this behaviour with GWT, submitting some
parameters via POST, opening a new browser window with that datasetID
being passed.

Anyone with similar experience?

Note: The action_script is not changable, requires data being passes
via POST, I cannot do anything in that side.

Thanks!!!!

walden

unread,
Nov 12, 2008, 1:12:57 PM11/12/08
to Google Web Toolkit
What I am hearing here is that in the existing system, a response or
redirect occurs after you POST to the action_script URL, which
replaces the document in the current window. But you want to use GWT
to make that same document open in a new window? And you have no
control over the server side implementation? I think you're stuck.
What comes back from the POST is a page reload, and that means your
GWT javascript in the original page is gone. Did I misunderstand the
plumbing?

If you want to open a new window to a known location in GWT, it looks
like this:

Window.open(new_url_string, unique_window_name, "");

I don't know if that helps though.


Walden

Cesc

unread,
Nov 25, 2008, 3:01:38 AM11/25/08
to Google Web Toolkit
Sorry for my delay.
Yes, I was playing with Window.open. The issue is that the url needs
soe POST parameters to be dislpayed properly (performs some action,
etc.), but as I can't post anything, is opens a blanks windos (It is
performing a GET instead, which it doesn't fit for my purposes).

Thanks anyway!

Thomas Broyer

unread,
Nov 26, 2008, 10:50:08 AM11/26/08
to Google Web Toolkit

On 12 nov, 12:34, Cesc <cesc.julbe.lo...@googlemail.com> wrote:
> Hi all,
> I've searching all around the discussions and although there were a
> few hints, I couoldn't find a suitable solution.
>
> In HTML, I have a form like:
>
> --------------
> <form name="retrieve" method="POST"action="http://action_script">
> <input type="submit" value="submit">
>
> <table >
> <tR>
> <td align=center><div style="padding: 1px 1px 1px 1px; background-
> color: rgb(0,255,0); border: solid black 1px;"><input name="dataset"
> type="checkbox" value="datasetID"></div></td><td>Dataset</td></tr>
> </table>
> </form>
> ----------------
>
> When I click on submit, a new url is opened and process the datasetID
> accordingly, for example, a new html page displaying: "You have
> selected datasetID="...." ".
>
> I want to reproduce this behaviour with GWT, submitting some
> parameters via POST, opening a new browser window with that datasetID
> being passed.
>
> Anyone with similar experience?

FormPanel form = new FormPanel("_blank"); // equivalent to
target=_blank in HTML
form.setAction("http://action_script");
form.setMethod(FormPanel.METHOD_POST);

// TODO: add some panels and your controls

Cesc

unread,
Dec 4, 2008, 5:32:32 AM12/4/08
to Google Web Toolkit
On Nov 26, 4:50 pm, Thomas Broyer <t.bro...@gmail.com> wrote:
>
> FormPanel form = new FormPanel("_blank"); // equivalent to
> target=_blank in HTML
> form.setAction("http://action_script");
> form.setMethod(FormPanel.METHOD_POST);
>
> // TODO: add some panels and your controls

That's the answer I was looking for.
Works perfect.
Thanks!!
Reply all
Reply to author
Forward
0 new messages