我是PrimeFaces的初学者,我不会保存包含输入密码的表单,但是当我尝试保存长度为2或3个字符的密码时,没有任何反应.按钮可能不起作用.这是我的榜样
<h:form id="mainForm">
<p:messages autoUpdate="true"/>
<p:panel header="Paramétrage des adresses">
<h:panelGrid id="createGrid"
columns="2"
cellspacing="100"
cellpadding="25">
<h:outputLabel for="pwd1" value="Mot de passe : *"/>
<p:password id="pwd1" value="#{adress.currentAdress.motDePasse}"
match="pwd2"
label="Mot de passe"
required="true"
maxlength="100">
<p:message for="pwd1"/>
</p:password>
<h:outputLabel for="pwd2" value="Confirmation Mot de passe : *"/>
<p:password id="pwd2"
value="#{adress.currentAdress.motDePasse}"
label="confirmation" required="true"/>
</h:panelGrid>
<p:commandButton id="saveAdress"
type="button" value="valider"
action="#{adress.save}"
update="createGrid dataTable"/>
</p:panel>
</h:form>
Run Code Online (Sandbox Code Playgroud)
你可以使用<f:validateLength>
标签来验证你的长度UIInput
,你的意思<p:password>
是这样的
<p:password id="pwd1" value="#{adress.currentAdress.motDePasse}" match="pwd2"
label="Mot de passe" required="true" maxlength="100">
<f:validateLength minimum="2" ></f:validateLength>
</p:password>
<p:message for="pwd1"/>
Run Code Online (Sandbox Code Playgroud)
每当您提交少于2个字符的密码时,这将触发验证错误.有关更多信息,看这里.
归档时间: |
|
查看次数: |
4453 次 |
最近记录: |