Actually, I was able to get this done.
I had to contributeValidationMessagesSource to get the messages.
And to get to the current page component from within the Validator, I
was able to do this:
public static void contributeFieldValidatorSource
(MappedConfiguration configuration,
Ok no worries.
On a related note, where do you put the messages file for a custom
validator? In the example below, which looks for a key called
'confirm', I have tried Confirm.properties (in same package as
validator called Confirm.java), Signup.properties (the page using the
validator) a
Sorry, those APIs are not in place yet. I have JIRA issue add
optional validators, which is a loose, general term for what you are
aiming for ("password is required if userName is given").
I think some relationships may not be expressable using the @Validate
annotation, i.e., the string represent
Not possible?
Sometimes a validator needs to look at input from another field to see
if it is valid (ie password/confirmPassword). I know it's easy to do
in onValidateForm, but I'd like to see how to do it in a nice modular
Validator. I'm looking for something like:
public void valida
Don't declare the field as mandatory.
Then add your custom validation to onValidateFromXXX where XXX is the
id of your form.
Validate the id there.
Alternatively, you could contribute your own validator, which doesn't
perform any client-side validation.
Robert
On Mar 21, 2008, at 3/219:50
Hi Robert,
oh i see, so for every validation you have to code two, one in java and
another one in js, this does bring up another question, can
'clientvalidation' be set in the field level? say, I have a form, all the
fields can be validated client side except a customer id field, which
requires u
One is for client-side validation, and the other is for server-side
validation?
Client-side validation is a nicety that makes the validation process
less painful for a client.
But you can't rely on it for any sort of "security" since all it takes
to bypass it is to turn of javascript.
Hence,
I've already found my answer in the magical
@Inject
private FieldValidatorSource _fieldValidatorSource;
with the
_fieldValidatorSource.createValidator(this, "myRegistredValidator", null);
everything works fine !
Bye
-Rick
Riccardo Ruffilli wrote:
>
> Hi All,
>
> I'm working on
uting
new validation messages and the actual validators)
Jon
-Original Message-
From: Jonathan Glanz [mailto:[EMAIL PROTECTED]
Sent: Monday, August 20, 2007 8:19 AM
To: 'Tapestry users'
Subject: RE: T5 Validator
All, I've got a couple of completely functional valdators now and
module code for contributing
new validation messages and the actual validators)
Jon
-Original Message-
From: Jonathan Glanz [mailto:[EMAIL PROTECTED]
Sent: Monday, August 20, 2007 8:19 AM
To: 'Tapestry users'
Subject: RE: T5 Validator
All, I've got a couple of completely
.
-Cheers, Jon
-Original Message-
From: Chris Lewis [mailto:[EMAIL PROTECTED]
Sent: Friday, August 17, 2007 11:04 AM
To: Tapestry users
Subject: Re: T5 Validator
Another option is to provide and explicit banner parameter to the error
component. You may not like having to set it ex
Another option is to provide and explicit banner parameter to the error
component. You may not like having to set it explicitly, but I
personally prefer doing that to overriding the prop file found on the
class path (fyi, adding a 'default-banner' message to the application
catalog doesn't work
See:
http://wiki.apache.org/tapestry/Tapestry5HowToOverrideTheDefaultErrorMessageBanner
Also, when you get your validator working, please consider adding it to the
wiki:
http://wiki.apache.org/tapestry/Tapestry5HowTos
Cheers,
Nick.
DougS wrote:
Also, is it possible to
override the default er
I've been able to create a Validator, but I am having problems getting the
Error Message to show up in my new Validator.
1.) First I copied one of the default T5 validators (I used the Required
class) -- here it is:
14 matches
Mail list logo