2012-01-17 19 views
1

我嘗試以下方法......PrimeFaces。 validateDoubleRange從豆

public class ProductBean { 
    public double LOWER_RATE; 
    public double UPPER_RATE; 
} 

<p:inputText id="myRate" value="#{productBean.DEFAULTVALUE}" validatorMessage="Value entered is not between the specified range"> 
    <f:validateDoubleRange minimum="#{productBean.LOWER_RATE}" maximum="#{productBean.UPPER_RATE}"/> 
</p:inputText> 
<p:watermark for="myRate" value="#{productBean.LOWER_RATE} : #{productBean.UPPER_RATE}" /> 

水印顯示1:20的有效範圍。即使輸入值介於1和20之間,我也會收到錯誤信息:「輸入的值不在指定的範圍內」

我做錯了什麼?

回答

0

由於使用validateDoubleRange無法滿足要求,因此我將驗證移至服務器端,並在dataTable的rowEditListener中保留邏輯。