users@woodstock.java.net

[Woodstock] customised validator message

From: <robert.hook_at_salmat.com.au>
Date: Wed, 03 Dec 2008 11:42:24 +1000

I have looked at the notes by Dmitry Kushner (http://blogs.sun.com/dmitry/entry/few_details_of_dynamic_functionality) and got my
page correctly invoking the validator on a text field on change of that text field, via Ajax. The trouble I now face is that the
validator is a simple Woodstock LongRangeValidator, and I cannot find any way to override or customise the error message it
produces. Particularly, in my JSP I have:

<webuijsf:textField binding="#{AddDatasource.textField5}" columns="4" id="textField5" maxLength="8"
          autoValidate="true"
          notify="form1:alert1"
          required="true"
          style="position: absolute; left: 264px; top: 192px"
          text="#{SessionBean1.currentDataSource.port}"
          toolTip="#{resources['tooltip.datasources.port']}"
          validatorExpression="#{AddDatasource.longRangeValidator1.validate}"/>

<webuijsf:alert id="alert1" visible="false"
          summary="#{resources['tooltip.datasources.port.brief']}"
          detail="#{resources['tooltip.datasources.port']}"
          style="height: 118px; left: 672px; top: 168px; position: absolute; width: 238px"/>

however the specified summary and detail are ignored and not displayed, instead the spectacularly unfriendly message
"form1:textField5: Validation Error: Specified attribute is not between the expected values of 1,024 and 65,535." is displayed twice.

Dmitry's notes suggest that it is possible to display customised messages - has anyone done this, and can point to examples? Is it a
case that the only way to do it is to build your own validator, rather than using the provided LongRangeValidator?
-- 
Robert Hook | Software Engineer for Salmat BusinessForce
16 Archimedes Pl
Murarrie QLD 4172 Australia
t   +61 (07) 3896 0896
f   +61 (07) 3899 5674
m   +61 0407 959 570
e   robert.hook_at_salmat.com.au
w   salmat.com.au
***********************************************************************************
This e-mail, including any attachments to it, may contain confidential and/or personal information. If you have received this e-mail in error, you must not copy, distribute, or disclose it, use or take any action based on the information contained within it. Please notify the sender immediately by return e-mail of the error and then delete the original e-mail.
The information contained within this e-mail may be solely the opinion of the sender and may not necessarily reflect the position, beliefs or opinions of the organisation on any issue. This email has been swept for the presence of computer viruses known to the organisation’s anti-virus systems.
***********************************************************************************