Thanks Lars,

That's the same *conclusion* I had come to :)

I'll have to override process I think (provided thats what's setting the
form elements back to the backing model).

The validators and the domain objects live in a module that has no wicket
dependencies, and I am not in a position to be able to introduce them.
(which means cannot just validate a wicket Form)

They will handle all input from the system (web services, rest, 3rd party
service calls, wicket app etc).

Not to fussed about the backing object getting updated to an invalid state -
because I will still be 
validating it - so it will never be persisted, or loaded as an invalid
model.

I have 95% of this working :) its just getting that damned modelObject
validated.  I "think" process is the only way.

Perhaps some event hooks could be added in future versions? - I dunno.

I'm getting more cosy with the wicket internals, but it takes time to
understand it all ;)


lars vonk wrote:
> 
> Hi Ned,
> 
> Here my 2 cents,
> 
> If you look at the Form.process method you'll see that only after
> validating the model object is updated. There is no hook that you can
> use to get a callback after the model object is updated. The only way
> I see is to override the process method itself (which is not
> recommended btw).
> 
> I think it might be a better solution to create a IFormValidator and
> call your SpringValidator from there. Then you can pass in the Form
> object itself into the Spring Validators and validate that instead of
> your Model objects.
> Also: When you allow invalid values in your Model you are basically
> putting you model classes in an illegal state which (depending on your
> code of course) can lead to strange behavior. In general it is good
> practice to only allow objects to be in a valid state, which of course
> depends on your definition of valid state :-).
> 
> Lars
> 

-- 
View this message in context: 
http://www.nabble.com/IFormValidator---I-need-some-clarification-please-tp18481522p18483780.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]

Reply via email to