我试图为我的应用程序登录视图实现浏览器自动完成功能。但似乎只有solution is through FormPanel。问题在于它打算与标准servlet一起使用;在这种情况下,我将需要重写我的“登录”代码,因为我拥有的是登录RPC。有没有办法做浏览器登录表单自动完成与登录服务使用GWT RPC?浏览器登录表单自动完成解决方案
编辑:
我尝试这样做的代码:
FormPanel form = FormPanel.wrap(Document.get().getElementById("login-input"), true);
form.setAction("javascript:;");
form.addFormPanel(new FormPanel() { // EDIT: method undefined?
public void onSubmit(FormSubmitEvent event) {
// do some validation before submitting (non-empty fields)
// and call event.setCancelled(true) if needed.
// get the fields values and do your GWT-RPC call or
// RequestBuilder thing here.
}
public void onSubmitComplete(FormSubmitCompleteEvent event) {
// will never be called.
}
});
然而,form.addFormPanel方法是不确定的。
一个原因是,我的应用程序USERLOGIN服务返回由该应用程序使用一个“用户”的对象。 – xybrek 2012-01-14 18:41:10