use of org.apache.wicket.markup.html.form.Radio 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();
}
use of org.apache.wicket.markup.html.form.Radio in project midpoint by Evolveum.
the class PageImportObject method initLayout.
private void initLayout() {
Form<?> mainForm = new MidpointForm<>(ID_MAIN_FORM);
mainForm.setMultiPart(true);
add(mainForm);
ImportOptionsPanel importOptions = new ImportOptionsPanel(ID_IMPORT_OPTIONS, optionsModel, fullProcessingModel);
mainForm.add(importOptions);
final WebMarkupContainer input = new WebMarkupContainer(ID_INPUT);
input.setOutputMarkupId(true);
mainForm.add(input);
WebMarkupContainer buttonBar = new WebMarkupContainer(ID_BUTTON_BAR);
buttonBar.setOutputMarkupId(true);
mainForm.add(buttonBar);
final IModel<Integer> groupModel = new Model<>(INPUT_FILE);
RadioGroup<Integer> importRadioGroup = new RadioGroup<>(ID_IMPORT_RADIO_GROUP, groupModel);
importRadioGroup.add(new AjaxFormChoiceComponentUpdatingBehavior() {
@Override
protected void onUpdate(AjaxRequestTarget target) {
target.add(input);
target.add(buttonBar);
}
});
mainForm.add(importRadioGroup);
Radio<Integer> fileRadio = new Radio<>(ID_FILE_RADIO, new Model<>(INPUT_FILE), importRadioGroup);
importRadioGroup.add(fileRadio);
Radio<Integer> xmlRadio = new Radio<>(ID_XML_RADIO, new Model<>(INPUT_XML), importRadioGroup);
importRadioGroup.add(xmlRadio);
WebMarkupContainer inputAce = new WebMarkupContainer(ID_INPUT_ACE);
addVisibileForInputType(inputAce, INPUT_XML, groupModel);
input.add(inputAce);
dataLanguage = determineDataLanguage();
DataLanguagePanel<List> languagePanel = new DataLanguagePanel<List>(ID_LANGUAGE_PANEL, dataLanguage, List.class, this) {
@Override
protected void onLanguageSwitched(AjaxRequestTarget target, int index, String updatedLanguage, String objectString) {
dataLanguage = updatedLanguage;
xmlEditorModel.setObject(objectString);
addOrReplaceEditor(inputAce);
target.add(mainForm);
}
@Override
protected String getObjectStringRepresentation() {
return xmlEditorModel.getObject();
}
};
inputAce.add(languagePanel);
addOrReplaceEditor(inputAce);
WebMarkupContainer inputFileLabel = new WebMarkupContainer(ID_INPUT_FILE_LABEL);
addVisibileForInputType(inputFileLabel, INPUT_FILE, groupModel);
input.add(inputFileLabel);
WebMarkupContainer inputFile = new WebMarkupContainer(ID_INPUT_FILE);
addVisibileForInputType(inputFile, INPUT_FILE, groupModel);
input.add(inputFile);
FileUploadField fileInput = new FileUploadField(ID_FILE_INPUT);
inputFile.add(fileInput);
initButtons(buttonBar, groupModel);
}
use of org.apache.wicket.markup.html.form.Radio in project midpoint by Evolveum.
the class PageNewReport method initLayout.
private void initLayout() {
Form mainForm = new Form(ID_MAIN_FORM);
add(mainForm);
final WebMarkupContainer input = new WebMarkupContainer(ID_INPUT);
input.setOutputMarkupId(true);
mainForm.add(input);
final WebMarkupContainer buttonBar = new WebMarkupContainer(ID_BUTTON_BAR);
buttonBar.setOutputMarkupId(true);
mainForm.add(buttonBar);
final IModel<Integer> groupModel = new Model<Integer>(INPUT_FILE);
RadioGroup importRadioGroup = new RadioGroup(ID_IMPORT_RADIO_GROUP, groupModel);
importRadioGroup.add(new AjaxFormChoiceComponentUpdatingBehavior() {
@Override
protected void onUpdate(AjaxRequestTarget target) {
target.add(input);
target.add(buttonBar);
}
});
mainForm.add(importRadioGroup);
Radio fileRadio = new Radio(ID_FILE_RADIO, new Model(INPUT_FILE), importRadioGroup);
importRadioGroup.add(fileRadio);
Radio xmlRadio = new Radio(ID_XML_RADIO, new Model(INPUT_XML), importRadioGroup);
importRadioGroup.add(xmlRadio);
WebMarkupContainer inputAce = new WebMarkupContainer(ID_INPUT_ACE);
addVisibileForInputType(inputAce, INPUT_XML, groupModel);
input.add(inputAce);
AceEditor aceEditor = new AceEditor(ID_ACE_EDITOR, xmlEditorModel);
aceEditor.setOutputMarkupId(true);
inputAce.add(aceEditor);
WebMarkupContainer inputFileLabel = new WebMarkupContainer(ID_INPUT_FILE_LABEL);
addVisibileForInputType(inputFileLabel, INPUT_FILE, groupModel);
input.add(inputFileLabel);
WebMarkupContainer inputFile = new WebMarkupContainer(ID_INPUT_FILE);
addVisibileForInputType(inputFile, INPUT_FILE, groupModel);
input.add(inputFile);
FileUploadField fileInput = new FileUploadField(ID_FILE_INPUT);
inputFile.add(fileInput);
initButtons(buttonBar, groupModel);
}
Aggregations