You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by Florian Rampp <Fl...@strip2study.de> on 2007/05/13 22:22:45 UTC

Proposal and question for handling of constants

Hello!

I've got one question and two proposals for commons validator!


1. Question: How can I get values for some constants out of the validator-framework? ValidatorResources.getConstants() unfortunately is protected! But I want to use the constants I defined somewhere else!

2. Proposal: What about making the above method public for this reason?

3. Proposal: It would really be nice, if I could set the constants using a java properties file!

4. Proposal: Am I right, that I currently can only use the javascript validation when I click the submit button? What if I want to validate a field when the focus leaves this field?


Thanks a lot in advance!


Florian

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Re: Proposal and question for handling of constants

Posted by Niall Pemberton <ni...@gmail.com>.
On 5/13/07, Florian Rampp <Fl...@strip2study.de> wrote:
> Hello!
>
> I've got one question and two proposals for commons validator!
>
>
> 1. Question: How can I get values for some constants out of the validator-framework? ValidatorResources.getConstants() unfortunately is protected! But I want to use the constants I defined somewhere else!

You could create your own implementation and expose the method as public.

> 2. Proposal: What about making the above method public for this reason?

Possibly, open a Jira ticket and describe the use-case.

> 3. Proposal: It would really be nice, if I could set the constants using a java properties file!

I don't see any benefit of this over the XML configuration - IMO will
just add confusion.

> 4. Proposal: Am I right, that I currently can only use the javascript validation when I click the submit button? What if I want to validate a field when the focus leaves this field?

Commons Validator provides nothing to invoke the JavaScript
validations for a field - Struts does, but it doesn't handle field
level validation - just forms as a whole. A couple of years back I
worked on doing this, but never finished it off or added it to
validator (so its probably not that likely yto happen)

http://issues.apache.org/jira/browse/VALIDATOR-106

Niall

> Thanks a lot in advance!
>
>
> Florian

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org