On 12/11/06, JS Portal support team <[EMAIL PROTECTED]> wrote:

Hi,

I have two questions concerning <s:commonsValidator> tag

1. Is there a way to set the message attribute of the s:commonsValidator
with the value resulting from?:

<h:outputFormat escape="false" value="#{labels['err.requiredField']}">
        <f:param value="#{labels['labels.user.email']}" />
</h:outputFormat>

This way I don't have to add a long list of err.required.email,
err.required.name etc. to my i18n properties files. Just a compilation
of my err.requiredField ({0} required) combined with the field name will
be enough.


If you do not specify messages for these keys in your own application
resource bundle, validator will fall back to its own default message
strings  ... so you don't have to override these unless the defaults do not
help you.

2. Is there a way to have the client check also print the error message
to the <h:message for="myField"/> in stead of having the JavaScript
alert pop up?


That is what would happen if the form is actually submitted, but the client
side checks are designed to prevent the form submit from happening if there
are any errors detected there -- so things never get far enough along for
the server side checks to kick in (unless you've disabled client side
Javascript).

Thank you and have a great day,
Joost Schouten
Director


Craig


JS Portal
Dasstraat 21
2623CB Delft
the Netherlands
P: +31 6 160 160 14
E: [EMAIL PROTECTED]
W: www.jsportal.com


Reply via email to