2012-01-14 104 views
1

我試圖爲我的應用程序登錄視圖實現瀏覽器自動完成功能。但似乎只有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方法是不確定的。

+0

一個原因是,我的應用程序USERLOGIN服務返回由該應用程序使用一個「用戶」的對象。 – xybrek 2012-01-14 18:41:10

回答

相關問題