2017-07-04 52 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!

相关问题