thanks Martin for the link , I used it but I had a problem;
public class CarPage extends WebPage {
* ......*
* ......*
UserModel user= ((LoginSession)getSession()).getUserBean();
* ......*
* ......*
* ......*
private void fillPersonalInfoComponents(Form personalForm) {
* ......*
* ...... *
PropertyModel fullnamepropertyModel =new
PropertyModel<String>(user, "fullNameValue");
fullName = new TextField("fullName", fullnamepropertyModel);
personalForm.add(fullName);
//System.out.println("Model =
"+fullnamepropertyModel.getChainedModel().getClass().getName());
fullName.add(new HibernateValidator<String>(fullnamepropertyModel,
"fullNameValue"));
}
}
And the user model is
public class UserModel implements Serializable {
/**
*
*/
private static final long serialVersionUID = 1011452297289823651L;
* ......*
* ......*
* ......*
@NotNull
@NotEmpty
private String fullNameValue;
* ......*
* ......*
* ......*
}
but it always fails and gives me that my model is null . but the strange
behaviour that when I changed HibernateValidator constructor
*from*
public HibernateValidator(I*Model entityModel*, String property) {
this.property = property;
if (entityModel != null)
hibernateValidator = new ClassValidator(*entityModel.getObject().getClass()*
);
}
*TO*
public HibernateValidator(*Object bean, *String property) {
this.property = property;
//if (entityModel != null)
hibernateValidator = new ClassValidator(*bean.getClass()*);
}
and did this
fullName.add(new HibernateValidator<String>(user, "fullNameValue"));
the validation worked *fine *!!!
so is there is any problem in the propertymodel with hibernate validator???
On Mon, Jan 4, 2010 at 8:37 AM, Martin Makundi <
[email protected]> wrote:
> http://42lines.net/content/integrating-hibernate-validator-and-wicket
>
> 2010/1/4 ayman elwany <[email protected]>:
> > Hi,
> >
> > Is there any common practice to integrate wicket with hibernate validator
> ?
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>