mirror of
https://gitee.com/jmix/cuba.git
synced 2024-11-30 02:07:41 +08:00
Support inputPrompt for PasswordField #1332
This commit is contained in:
parent
f6e4fab95d
commit
099b49882f
@ -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";
|
||||||
|
|
||||||
|
@ -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>
|
||||||
|
@ -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)) {
|
||||||
|
@ -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);
|
||||||
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user