Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GWT simple web form submit - redirect to new page

Tags:

java

gwt

I have a simple web form written in Google web toolkit. I want the user to follow a new URL when he clicks on the submit button. However I cannot find any examples of redirecting the user to a new URL from within GWT code. How may I achieve this?

like image 872
user434541 Avatar asked Dec 08 '22 01:12

user434541


1 Answers

the exact answer is:

    form.getElement().<FormElement>cast().setTarget("");

by this line you changing the target parameter of the form and now the main page redirected to the action url.

be careful that Window.Location.assign() makes a new GET request after your main POST request!, So it is not the answer.

like image 85
mirzaei Avatar answered Dec 09 '22 13:12

mirzaei