You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Marios Skounakis <ms...@gmail.com> on 2013/06/25 18:53:47 UTC

What is the purpose of Validatable.model?

Hi all,

What is the purpose of Validatable.model?

I don't seem to be able to find any usages of Validatable.getModel(),
setModel() or model...

Thanks
Marios

Re: What is the purpose of Validatable.model?

Posted by Marios Skounakis <ms...@gmail.com>.
Thank you both for your answers.

I wonder what would be best if you want to use the same validation
framework in multiple scenarios. I have a domain object that can be updated
either by a wicket form or by uploading an excel file. I want to have the
same validation logic. Would it be best to use an external validation
component (e.g. beans validation or spring validation) or would it be best
to write some custom code to use wicket validators outside a wicket form?
Do you have any thoughts on this?



On Wed, Jun 26, 2013 at 10:34 AM, Martin Grigorov <mg...@apache.org>wrote:

> Hi,
>
> Additionally the validatable's model brings the form component model - this
> is the current value. The validatable's value is the next value. You can
> use them like in a state machine - you can move to a new state/value only
> from some of the other states/values, but not from all.
>
>
> On Wed, Jun 26, 2013 at 8:10 AM, Igor Vaynberg <igor.vaynberg@gmail.com
> >wrote:
>
> > this method is useful for validators that integrate with other
> > frameworks. take for example bean-validation framework.
> >
> > a bean validation validator can call getModel(), get the model, cast
> > it to IPropertyReflectionAwareModel, get the property, and retrieve
> > validation annotations associated with it.
> >
> > -igor
> >
> >
> > On Tue, Jun 25, 2013 at 9:53 AM, Marios Skounakis <ms...@gmail.com>
> > wrote:
> > > Hi all,
> > >
> > > What is the purpose of Validatable.model?
> > >
> > > I don't seem to be able to find any usages of Validatable.getModel(),
> > > setModel() or model...
> > >
> > > Thanks
> > > Marios
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> > For additional commands, e-mail: users-help@wicket.apache.org
> >
> >
>

Re: What is the purpose of Validatable.model?

Posted by Martin Grigorov <mg...@apache.org>.
Hi,

Additionally the validatable's model brings the form component model - this
is the current value. The validatable's value is the next value. You can
use them like in a state machine - you can move to a new state/value only
from some of the other states/values, but not from all.


On Wed, Jun 26, 2013 at 8:10 AM, Igor Vaynberg <ig...@gmail.com>wrote:

> this method is useful for validators that integrate with other
> frameworks. take for example bean-validation framework.
>
> a bean validation validator can call getModel(), get the model, cast
> it to IPropertyReflectionAwareModel, get the property, and retrieve
> validation annotations associated with it.
>
> -igor
>
>
> On Tue, Jun 25, 2013 at 9:53 AM, Marios Skounakis <ms...@gmail.com>
> wrote:
> > Hi all,
> >
> > What is the purpose of Validatable.model?
> >
> > I don't seem to be able to find any usages of Validatable.getModel(),
> > setModel() or model...
> >
> > Thanks
> > Marios
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

Re: What is the purpose of Validatable.model?

Posted by Igor Vaynberg <ig...@gmail.com>.
this method is useful for validators that integrate with other
frameworks. take for example bean-validation framework.

a bean validation validator can call getModel(), get the model, cast
it to IPropertyReflectionAwareModel, get the property, and retrieve
validation annotations associated with it.

-igor


On Tue, Jun 25, 2013 at 9:53 AM, Marios Skounakis <ms...@gmail.com> wrote:
> Hi all,
>
> What is the purpose of Validatable.model?
>
> I don't seem to be able to find any usages of Validatable.getModel(),
> setModel() or model...
>
> Thanks
> Marios

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org