First, your understanding of TextField<Withdrawal>
with CompoundPropertyModel
ist wrong: The CompoundPropertyModel is responsible for binding a property specified by the name via PropertyModel
to the TextField.
So you do not need generic StringValidator
objects for the TextField.
In Wicket 6.7:
TextField<Withdrawal> tf_comments = new TextField<Withdrawal>("comment");
tf_comments.add(StringValidator.maximumLength(255));
For Wicket 1.5 your code should work, at least I'm not getting any syntax errors. You should have getter and setter for "comment" in the Withdrawal class.