I have overridden my org.apache.wicket.protocol.http.WebApplication's
newConverterLocator() method by setting my own custom IConverter for the
Float class in this method's returned ConverterLocator object.
This has the desired affect for my TextField<Float> components. However, I
have noticed that this custom conversion is not applied to feedback messages
resulting from these components' RangeValidator<Float>(...) validators.
Does anyone know how I can adjust the formatting of validators, or am I just
stuck with what I get? (I set out relevant output and code snippets below.)
Feedback message displayed
--------------------------
Your entered value is either less than the minimum of £0.01 or greater than
the maximum of £1.0E7 that we allow.
HTML mark-up
------------
<input type="text" wicket:id="flMinPriceInPounds" size="12"/>
Java code
---------
TextField<Float> txtMinPriceInPounds =
new TextField<Float>("flMinPriceInPounds", Float.class);
txtMinPriceInPounds.add(new RangeValidator<Float>(Float.valueOf(0.01f),
Float.valueOf(10000000.00f)));
frmForm.add(txtMinPriceInPounds);
Property for component validator
--------------------------------
frmForm.flMinPriceInPounds.RangeValidator = Your entered value is \
either less than the minimum of £${minimum} \
or greater than the maximum of £${maximum} that we allow.
Feedback message generated mark-up
----------------------------------
<div wicket:id="fbpnlFeedbackPanel">
<wicket:panel>
<ul wicket:id="feedbackul" class="feedbackPanel">
<li wicket:id="messages"
class="feedbackPanelERROR">
Your entered value is either less than
the minimum of £0.01 or greater
than the maximum of £1.0E7 that we allow.
</li>
</ul>
</wicket:panel>
</div>
--
View this message in context:
http://apache-wicket.1842946.n4.nabble.com/What-governs-how-component-validators-are-formatted-tp3081781p3081781.html
Sent from the Users forum mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]