Note that there are some explanatory texts on larger screens.

plurals
  1. POJSF validateLength question
    text
    copied!<p>I have a input field with validation to validate the max and min length</p> <pre><code>&lt;h:inputText id="LABEL_ID" styleClass="textboxsmall" value="#{sampleDatatableBean.accessionLabelId}" maxlength="5"&gt; &lt;f:validateLength minimum="4" maximum="5" /&gt; &lt;/h:inputText&gt; &lt;br/&gt;&lt;h:message id="LABEL_ID_MSG" styleClass="errorMessage" for="LABEL_ID" /&gt; </code></pre> <p>It validates but I get the below message:</p> <blockquote> <p>"Value is less than allowable minimum of {0}"</p> </blockquote> <p>Shouldn't <code>{0}</code> be replaced by value from minimum? Not sure why its not picking up the value. Any ideas?</p> <pre><code>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 </code></pre> <p>AppServer:jboss-4.0.5.GA</p> <p>Works for</p> <pre><code>&lt;f:validateLongRange minimum="100" maximum="999" /&gt; </code></pre> <hr> <p><strong>FIXED</strong> Seems to work after adding the _detail in the ErrorMessages_en.properties file.</p> <pre><code>javax.faces.validator.LengthValidator.MAXIMUM_detail = Value is longer than allowable maximum of {0} characters. </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload