use of org.apache.openmeetings.db.entity.room.Invitation.Valid in project openmeetings by apache.
the class InvitationForm method onInitialize.
@Override
protected void onInitialize() {
add(subject, message);
recipients.setLabel(Model.of(getString("216"))).setRequired(true).add(new AjaxFormComponentUpdatingBehavior("change") {
private static final long serialVersionUID = 1L;
@Override
protected void onUpdate(AjaxRequestTarget target) {
url.setModelObject(null);
updateButtons(target);
}
}).setOutputMarkupId(true);
add(new AjaxCheckBox("passwordProtected") {
private static final long serialVersionUID = 1L;
@Override
protected void onUpdate(AjaxRequestTarget target) {
InvitationForm.this.getModelObject().setPasswordProtected(getConvertedInput());
passwd.setEnabled(getConvertedInput());
target.add(passwd);
}
});
RadioGroup<Valid> valid = new RadioGroup<>("valid");
valid.add(new AjaxFormChoiceComponentUpdatingBehavior() {
private static final long serialVersionUID = 1L;
@Override
protected void onUpdate(AjaxRequestTarget target) {
boolean dateEnabled = InvitationForm.this.getModelObject().getValid() == Valid.Period;
target.add(from.setEnabled(dateEnabled), to.setEnabled(dateEnabled), timeZoneId.setEnabled(dateEnabled));
}
});
add(valid.add(new Radio<>("one", Model.of(Valid.OneTime)), new Radio<>("period", Model.of(Valid.Period)), new Radio<>("endless", Model.of(Valid.Endless))));
add(passwd);
Invitation i = getModelObject();
passwd.setLabel(Model.of(getString("110"))).setOutputMarkupId(true).setEnabled(i.isPasswordProtected());
add(from.setOutputMarkupId(true), to.setOutputMarkupId(true), timeZoneId.setOutputMarkupId(true));
timeZoneId.add(new AjaxFormComponentUpdatingBehavior("change") {
private static final long serialVersionUID = 1L;
@Override
protected void onUpdate(AjaxRequestTarget target) {
// no-op added to preserve selection
}
});
add(url.setOutputMarkupId(true));
add(lang, feedback);
super.onInitialize();
}
Aggregations