JSF validateLength问题 [英] JSF validateLength question

查看:72
本文介绍了JSF validateLength问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个带有验证的输入字段,用于验证最大长度和最小长度

I have a input field with validation to validate the max and min length

<h:inputText id="LABEL_ID" styleClass="textboxsmall" value="#{sampleDatatableBean.accessionLabelId}" maxlength="5">
    <f:validateLength minimum="4" maximum="5" />
</h:inputText>
<br/><h:message id="LABEL_ID_MSG" styleClass="errorMessage" for="LABEL_ID" />

它可以验证,但是我收到以下消息:

It validates but I get the below message:

值小于允许的最小值{0}"

"Value is less than allowable minimum of {0}"

{0}不应被最小值中的值代替吗?不知道为什么它没有拿起价值.有什么想法吗?

Shouldn't {0} be replaced by value from minimum? Not sure why its not picking up the value. Any ideas?

Version info:
myfaces-api-1.1.5.jar:
Manifest-Version: 1.0 
Archiver-Version: Plexus Archiver 
Created-By: Apache Maven 
Built-By: mrmaven 
Build-Jdk: 1.5.0_11 
Implementation-Title: API 
Implementation-Version: 1.1.6-SNAPSHOT 
Implementation-Vendor-Id: org.apache.myfaces.core 
Implementation-Vendor: Apache Software Foundation 

myfaces-impl-1.1.5.jar:
Manifest-Version: 1.0
Archiver-Version: Plexus Archiver
Created-By: Apache Maven
Built-By: mrmaven
Build-Jdk: 1.5.0_11
Implementation-Title: Impl
Implementation-Version: 1.1.6-SNAPSHOT
Implementation-Vendor-Id: org.apache.myfaces.core
Implementation-Vendor: Apache Software Foundation

AppServer:jboss-4.0.5.GA

AppServer:jboss-4.0.5.GA

适用于

<f:validateLongRange   minimum="100"   maximum="999" />


已修复 在ErrorMessages_en.properties文件中添加_detail后,似乎可以正常工作.


FIXED Seems to work after adding the _detail in the ErrorMessages_en.properties file.

javax.faces.validator.LengthValidator.MAXIMUM_detail = Value is longer than allowable 
maximum of {0} characters.

推荐答案

已修复似乎在ErrorMessages_en.properties文件中添加了"javax.faces.validator.LengthValidator.MAXIMUM_detail"后可以正常工作.

FIXED Seems to work after adding the "javax.faces.validator.LengthValidator.MAXIMUM_detail" in the ErrorMessages_en.properties file.

这篇关于JSF validateLength问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆