use of com.evolveum.midpoint.web.component.input.TextAreaPanel in project midpoint by Evolveum.
the class ImportReportPopupPanel method initLayout.
protected void initLayout() {
Form<?> mainForm = new MidpointForm<>(ID_MAIN_FORM);
add(mainForm);
FeedbackAlerts feedback = new FeedbackAlerts(ID_POPUP_FEEDBACK);
feedback.setOutputMarkupId(true);
mainForm.add(feedback);
Model<String> nameModel = Model.of("");
TextPanel nameField = new TextPanel(ID_NAME_FOR_DATA, nameModel);
nameField.setOutputMarkupId(true);
mainForm.add(nameField);
Model<String> fileStringModel = Model.of("");
TextAreaPanel fileStringField = new TextAreaPanel(ID_FILE_AS_NAME, fileStringModel, 5);
fileStringField.setOutputMarkupId(true);
mainForm.add(fileStringField);
AjaxSubmitButton importButton = new AjaxSubmitButton(ID_IMPORT_BUTTON, createStringResource("PageReports.button.import")) {
@Override
protected void onSubmit(AjaxRequestTarget target) {
importConfirmPerformed(target, nameModel, fileStringModel);
}
@Override
protected void onError(AjaxRequestTarget target) {
FeedbackAlerts feedback = (FeedbackAlerts) getForm().get(ID_POPUP_FEEDBACK);
target.add(feedback);
}
};
mainForm.add(importButton);
AjaxButton cancelButton = new AjaxButton(ID_CANCEL_BUTTON, createStringResource("userBrowserDialog.button.cancelButton")) {
private static final long serialVersionUID = 1L;
@Override
public void onClick(AjaxRequestTarget target) {
ImportReportPopupPanel.this.getPageBase().hideMainPopup(target);
}
};
cancelButton.setOutputMarkupId(true);
mainForm.add(cancelButton);
FileUploadField choseFile = new FileUploadField(ID_CHOSE_FILE);
mainForm.add(choseFile);
}
Aggregations