MaxLengthPanel maxLengthPanel;
public PasswordPolicyPanel(String id, IModel<PasswordPolicyConfig> model) {
super(id, model);
PasswordPolicyConfig pwPolicy = model.getObject();
//add(new TextField("name").setRequired(true));
add(new CheckBox("digitRequired"));
add(new CheckBox("uppercaseRequired"));
add(new CheckBox("lowercaseRequired"));
add(new TextField<Integer>("minLength"));
boolean unlimited = pwPolicy.getMaxLength() == -1;
add(new AjaxCheckBox("unlimitedMaxLength", new Model(unlimited)) {
@Override
protected void onUpdate(AjaxRequestTarget target) {
Boolean value = getModelObject();