users@woodstock.java.net

Re: [Woodstock] customised validator message

From: <daniel.jank_at_de.marposs.com>
Date: Wed, 3 Dec 2008 14:36:00 +0100

Hi Tony,

I also have troubles with this issue. I use a text field with a Double
Range Validator.
The customized validators work for the "REQUIRED" and the "NOT_IN_RANGE"
validation check, but not for the TYPE check..if I prompt same letters
into the text field the original
validator messages from woodstock.

Any ideas?

Thanks, Daniel




Antonin Karasek <tonda_at_ceskyserver.cz>
03.12.2008 08:36
Please respond to
users_at_woodstock.dev.java.net


To
users_at_woodstock.dev.java.net
cc

Subject
Re: [Woodstock] customised validator message






Useful staff about validation here:

http://www.netbeans.org/kb/docs/web/convert-validate.html

See "Doing More: Customizing a Standard Validator Message" section...

Hope this will help ;-)

Regards
                 Tony

robert.hook_at_salmat.com.au wrote:
> 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?


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe_at_woodstock.dev.java.net
For additional commands, e-mail: users-help_at_woodstock.dev.java.net