use of org.apache.openmeetings.web.util.DateLabel in project openmeetings by apache.
the class UserForm method onInitialize.
@Override
protected void onInitialize() {
super.onInitialize();
add(password.setResetPassword(false).setLabel(Model.of(getString("110"))).setRequired(false).add(passValidator = new StrongPasswordValidator(getMinPasswdLength(cfgDao), getModelObject())));
login.setLabel(Model.of(getString("108")));
add(login.add(minimumLength(getMinLoginLength(cfgDao))));
add(new DropDownChoice<>("type", Arrays.asList(Type.values())).add(new OnChangeAjaxBehavior() {
private static final long serialVersionUID = 1L;
@Override
protected void onUpdate(AjaxRequestTarget target) {
updateDomain(target);
}
}));
update(null);
add(domain.add(domainId).setOutputMarkupId(true).setOutputMarkupPlaceholderTag(true));
add(new Label("ownerId"));
add(new DateLabel("inserted"));
add(new DateLabel("updated"));
add(new CheckBox("forceTimeZoneCheck"));
add(new Select2MultiChoice<>("rights", null, new RestrictiveChoiceProvider<Right>() {
private static final long serialVersionUID = 1L;
@Override
public String getDisplayValue(Right choice) {
return choice.name();
}
@Override
public String toId(Right choice) {
return choice.name();
}
@Override
public void query(String term, int page, Response<Right> response) {
boolean isGroupAdmin = hasGroupAdminLevel(getRights());
for (Right r : Right.values()) {
if (Right.GroupAdmin == r) {
continue;
}
if (isGroupAdmin && (Right.Admin == r || Right.Soap == r)) {
continue;
}
if (Strings.isEmpty(term) || r.name().contains(term)) {
response.add(r);
}
}
}
@Override
public Right fromId(String id) {
return Right.valueOf(id);
}
}));
add(new ComunityUserForm("comunity", getModel()));
// attach an ajax validation behavior to all form component's keydown
// event and throttle it down to once per second
add(new AjaxFormValidatingBehavior("keydown", Duration.ONE_SECOND));
add(adminPass);
}
Aggregations