harrypitt wrote:
Thanks for that solution,
To summarize that:
- Extend a normal Validator
- Add the IValidatorAddListener Interface
- Implement the onAdded method
- In this method: add a Custom Behavior to the component
- In the custom Behavior: Integrate the js like described here:
http://cwiki.apache.org/WICKET/creating-a-behavior-to-use-a-javascript-library.html
But I think there are two weak points in that implementation (correct me if
I'm wrong):
- I have to rewrite the whole logic für the validator in Javascript (ok,
that's no surprise)
- In case the validator gets an error, I have to do an ajax request to
trigger the wicket feedback message system (a js only feedback would be a
problem, because js validation would produce duplicate messages after a
submit with errors). So in general I only avoid the ajax request if the js
validator finds no errors.
I have some additional questions about this topic:
- Are there any example implementations for such client side validations?
- There is also a Wicket-Stuff project "fvalidate": Has this project a
different concept?
- Is there a plan to integrate pure client side validation in the wicket
framework soon?
I wont be doing pure client side validation, as it is unsafe..
Harry
igor.vaynberg wrote:
it is possible, just not there out of the box. can look like something
like this
class rangejsvalidator extends rangevalidator implements
IValidatorAddListener {
void onAdded(Component component) { // add some behavior to output
javascript validation }
}
-igor
--
-Wicket for love
Nino Martinez Wael
Java Specialist @ Jayway DK
http://www.jayway.dk
+45 2936 7684
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]