如果输入-ve值,我想应用验证。我能做到这一点使用下面的标签和属性:不允许h中的负数:inputText
<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和+已经值下面输入: 走到正确的:我在下面的荷兰号系统中“”被视为'。'。例如写0.55,我们需要写0.55),这是由我使用<f:convertNumber>
完成的。
100
10.25
10,98
-100
-10.25
-10,98
0.55
但是当我输入-0.55时,验证不起作用。请提供解决方案,以验证我何时输入-ve值以-0.xx开头。
您是否在此检查过? http://stackoverflow.com/questions/19765009/does-fconvertnumber-use-the-right-number-separator-when-using-patterns-to-for/ – pleft