Support inputPrompt for PasswordField #1332

This commit is contained in:
Yuriy Artamonov 2018-10-04 21:53:58 +04:00
parent f6e4fab95d
commit 099b49882f
4 changed files with 13 additions and 1 deletions

View File

@ -17,7 +17,7 @@
package com.haulmont.cuba.gui.components; package com.haulmont.cuba.gui.components;
public interface PasswordField extends TextInputField<String>, TextInputField.MaxLengthLimited { public interface PasswordField extends TextInputField<String>, TextInputField.MaxLengthLimited, HasInputPrompt {
String NAME = "passwordField"; String NAME = "passwordField";

View File

@ -1424,6 +1424,7 @@
<xs:attribute name="maxLength" type="xs:int"/> <xs:attribute name="maxLength" type="xs:int"/>
<xs:attribute name="autocomplete" type="xs:boolean"/> <xs:attribute name="autocomplete" type="xs:boolean"/>
<xs:attribute name="capsLockIndicator" type="xs:string"/> <xs:attribute name="capsLockIndicator" type="xs:string"/>
<xs:attribute name="inputPrompt" type="resourceString"/>
<xs:attributeGroup ref="hasBuffered"/> <xs:attributeGroup ref="hasBuffered"/>
</xs:extension> </xs:extension>

View File

@ -34,6 +34,7 @@ public class PasswordFieldLoader extends AbstractTextFieldLoader<PasswordField>
super.loadComponent(); super.loadComponent();
loadMaxLength(resultComponent, element); loadMaxLength(resultComponent, element);
loadInputPrompt(resultComponent, element);
String autocomplete = element.attributeValue("autocomplete"); String autocomplete = element.attributeValue("autocomplete");
if (StringUtils.isNotEmpty(autocomplete)) { if (StringUtils.isNotEmpty(autocomplete)) {

View File

@ -143,4 +143,14 @@ public class WebPasswordField extends WebV8AbstractField<CubaPasswordField, Stri
public CapsLockIndicator getCapsLockIndicator() { public CapsLockIndicator getCapsLockIndicator() {
return capsLockIndicator; return capsLockIndicator;
} }
@Override
public String getInputPrompt() {
return component.getPlaceholder();
}
@Override
public void setInputPrompt(String inputPrompt) {
component.setPlaceholder(inputPrompt);
}
} }