|
22 | 22 | import com.smartgwt.client.widgets.form.DynamicForm; |
23 | 23 | import com.smartgwt.client.widgets.form.ValuesManager; |
24 | 24 | import com.smartgwt.client.widgets.form.fields.ButtonItem; |
25 | | -import com.smartgwt.client.widgets.form.fields.FormItemIcon; |
26 | 25 | import com.smartgwt.client.widgets.form.fields.PasswordItem; |
27 | 26 | import com.smartgwt.client.widgets.form.fields.events.ClickEvent; |
28 | | -import com.smartgwt.client.widgets.form.fields.events.FormItemIconClickEvent; |
29 | 27 | import com.smartgwt.client.widgets.form.validator.MatchesFieldValidator; |
30 | 28 |
|
31 | 29 | /** |
@@ -61,31 +59,18 @@ public ChangePassword(final GUIUser user, final LoginPanel loginPanel) { |
61 | 59 | form.setWidth(300); |
62 | 60 | form.setMargin(5); |
63 | 61 |
|
64 | | - PasswordItem password = ItemFactory.newPasswordItemPreventAutocomplete(PASSWORD, "currentpassword", null); |
| 62 | + PasswordItem password = ItemFactory.newPasswordItemPreventAutocomplete(PASSWORD, PASSWORD, null); |
65 | 63 | password.setRequired(true); |
66 | 64 |
|
67 | 65 | MatchesFieldValidator equalsValidator = new MatchesFieldValidator(); |
68 | 66 | equalsValidator.setOtherField(NEWPASSWORDAGAIN); |
69 | 67 | equalsValidator.setErrorMessage(I18N.message("passwordnotmatch")); |
70 | 68 |
|
71 | | - PasswordItem newPass = ItemFactory.newPasswordItemPreventAutocomplete(NEWPASSWORD, NEWPASSWORD, null); |
| 69 | + PasswordItem newPass = ItemFactory.newPasswordItemPreventAutocomplete(NEWPASSWORD, NEWPASSWORD, null, true); |
| 70 | + newPass.setWrapTitle(false); |
72 | 71 | newPass.setRequired(true); |
73 | 72 | newPass.setValidators(equalsValidator, new MinLengthValidator(user.getPasswordMinLenght())); |
74 | 73 |
|
75 | | - FormItemIcon generator = new FormItemIcon(); |
76 | | - generator.setName("generator"); |
77 | | - generator.setWidth(16); |
78 | | - generator.setHeight(16); |
79 | | - |
80 | | - generator.setSrc("[SKIN]/key.png"); |
81 | | - generator.setPrompt(I18N.message("passwordgenerator")); |
82 | | - generator.addFormItemClickHandler((FormItemIconClickEvent event) -> { |
83 | | - PasswordGenerator pswGenerator = new PasswordGenerator(user.getUsername()); |
84 | | - pswGenerator.show(); |
85 | | - }); |
86 | | - newPass.setIcons(generator); |
87 | | - newPass.setIconVAlign(VerticalAlignment.CENTER); |
88 | | - |
89 | 74 | PasswordItem newPassAgain = ItemFactory.newPasswordItemPreventAutocomplete(NEWPASSWORDAGAIN, NEWPASSWORDAGAIN, |
90 | 75 | null); |
91 | 76 | newPassAgain.setWrapTitle(false); |
@@ -167,7 +152,7 @@ else if (ret == 3) { |
167 | 152 | } |
168 | 153 | }); |
169 | 154 | } |
170 | | - |
| 155 | + |
171 | 156 | @Override |
172 | 157 | public boolean equals(Object other) { |
173 | 158 | return super.equals(other); |
|
0 commit comments