【发布时间】:2016-06-12 16:06:47
【问题描述】:
如果输入了 -ve 值,我想应用验证。我可以使用以下标签和属性来做到这一点:
<h:inputText id="MyPrice" validatorMessage="negatieve prijs niet toegestaan">
<f:convertNumber type="number"
groupingUsed="true"
locale="nl_NL"
maxFractionDigits="2"
minFractionDigits="2"/>
<f:validateLongRange minimum="0"/>
<h:inputText>
<rich:message for="MyPrice"/>
使用它,我可以通过以下输入成功验证 -ve 和 +ve 值:
正确:[我遵循荷兰数字系统,其中“,”被视为“。”例如,要写 0.55,我们需要写 0,55),这是我使用 <f:convertNumber> 完成的。
100
10.25
10,98
-100
-10.25
-10,98
0.55
但是当我输入 -0,55 时,验证不起作用。请提供解决方案以验证我何时输入以 -0.xx 开头的 -ve 值。
【问题讨论】:
标签: validation jsf richfaces