Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Invalid
-
None
-
None
-
None
Description
During creation of PropertyValidator if Model is empty (it is set during runtime):
IModel<User> model = new Model<>(); CompoundPropertyModel<User> compound = new CompoundPropertyModel<>(model); TextField<String> tf = new TextField<>("email", compound.bind("email")); tf.add(new PropertyValidator<>()); add(tf);
an exception is thrown:
Last cause: Could not resolve Bean Property from component: [TextField [Component id = email]]. (Hints:) Possible causes are a typo in the PropertyExpression, a null reference or a model that does not work in combination with a IPropertyResolver. Model : Model:classname=[org.apache.wicket.model.PropertyModel]:nestedModel=[Model:classname=[org.apache.wicket.model.CompoundPropertyModel]:nestedModel=[Model:classname=[org.apache.wicket.model.Model]:object=[null]]]:expression=[email] WicketMessage: Error attaching this container for rendering: [UserPanel [Component id = formPanel]]
without this line:
tf.add(new PropertyValidator<>());
everything works