GWT简单的网页表单提交 - 重定向到新页面 [英] GWT simple web form submit - redirect to new page

查看:292
本文介绍了GWT简单的网页表单提交 - 重定向到新页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用Google网络工具包编写了一个简单的网页表单。我希望用户在点击提交按钮时按照新的URL。但是我找不到任何将用户重定向到GWT代码中的新URL的示例。如何才能实现这一目标?

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?

推荐答案

要将用户重定向到新页面,请使用 Window.Location.assign()

To redirect the user to a new page, use Window.Location.assign().

要在用户提交表单时发生这种情况,请使用 FormPanel.addSubmitHandler() addSubmitCompleteHandler() 在表单提交完成时发生重定向。

To have this happen when the user submits the form, use FormPanel.addSubmitHandler() , or addSubmitCompleteHandler() to have the redirect happen when the form submission is complete.

这篇关于GWT简单的网页表单提交 - 重定向到新页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆