Re: Pure client side validation

2008-10-02 Thread harrypitt

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?  

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
 
 
-- 
View this message in context: 
http://www.nabble.com/Pure-client-side-validation-tp19737383p19774599.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Pure client side validation

2008-10-02 Thread harrypitt

Ok, my question was not clear enough.

With Pure client side validation i mean a javascript validation which
needs no ajax requests. Of course there should be always a server side
validation and the whole default Wicket form-handling AFTER the submit. It
would be really stupid to just rely on javascript validation. 


Nino.Martinez wrote:
 
 I wont be doing pure client side validation, as it is unsafe..
 

-- 
View this message in context: 
http://www.nabble.com/Pure-client-side-validation-tp19737383p19777140.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Pure client side validation

2008-09-30 Thread harrypitt

Hi,

The company I'm working for is evaluating different java-web-frameworks and
it seems that Wicket or JSF will be the winner (To be honest, my personal
opinion is that Wicket is the far better choice). In this evaluation i have
to make sure if the framework supports pure (java script) client side
validation.

As far as i know Wicket only supports client side validation with ajax
requests. This solution is not satisfying for us, because we want to use the
framework to create huge forms which are used by many people. And we think
it would be a hard job for our servers to process all that requests.  

My question: Is it possible to create light weight validators (like required
validator) that are working with java script and act like normal wicket
validators:  

textField.add(new ClientSideRequiredValidator());
  
I know that this topic was discussed in the mailing list many times, but i
haven't found a real solution for this.  

Harry

 
-- 
View this message in context: 
http://www.nabble.com/Pure-client-side-validation-tp19737383p19737383.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]