2017-07-04 50 views
0

我有以下代碼來檢查我的密碼字段isValid,然後啓用登錄按鈕。GWT SENCHA密碼字段未在瀏覽器填寫上正確驗證

Scheduler.get().scheduleFixedDelay(new Scheduler.RepeatingCommand() { 
      @Override 
      public boolean execute() { 
       login.setEnabled(isValid()); // checks password field 
       return !hasLoggedIn; 
      } 
     }, 100); 

但是我

private PasswordField password; 

返回null填充/通過瀏覽器記住即使在所有的時間 - 直到按下一個鍵/鼠標點擊。如果我按任意鍵,或單擊鼠標按鈕(網頁上的任何位置),則密碼字段會返回一個值(並正確驗證)。

如何在瀏覽器填充密碼字段被記住時自動啓用登錄按鈕?

+1

如果它僅在Chrome中發生,則可能與https://stackoverflow.com/questions/35049555/chrome-autofill-autocomplete-no-value-for-password相關 –

+0

爲什麼不使用KeyPressHandler? –

+0

@ElHoss做什麼?它不會解決我的問題。 – NimChimpsky

回答

0
String bgColor = cell.getAppearance().getInputElement(passwordField.getElement()).getComputedStyle("background-color"); 

然後,如果它的黃色,我可以啓用按鈕。

Hacktastic!

相關問題