Search in sources :

Example 1 with TextAreaPanel

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);
}
Also used : AjaxRequestTarget(org.apache.wicket.ajax.AjaxRequestTarget) AjaxSubmitButton(com.evolveum.midpoint.web.component.AjaxSubmitButton) AjaxButton(com.evolveum.midpoint.web.component.AjaxButton) FeedbackAlerts(com.evolveum.midpoint.web.component.message.FeedbackAlerts) TextPanel(com.evolveum.midpoint.web.component.input.TextPanel) MidpointForm(com.evolveum.midpoint.web.component.form.MidpointForm) TextAreaPanel(com.evolveum.midpoint.web.component.input.TextAreaPanel) FileUploadField(org.apache.wicket.markup.html.form.upload.FileUploadField)

Aggregations

AjaxButton (com.evolveum.midpoint.web.component.AjaxButton)1 AjaxSubmitButton (com.evolveum.midpoint.web.component.AjaxSubmitButton)1 MidpointForm (com.evolveum.midpoint.web.component.form.MidpointForm)1 TextAreaPanel (com.evolveum.midpoint.web.component.input.TextAreaPanel)1 TextPanel (com.evolveum.midpoint.web.component.input.TextPanel)1 FeedbackAlerts (com.evolveum.midpoint.web.component.message.FeedbackAlerts)1 AjaxRequestTarget (org.apache.wicket.ajax.AjaxRequestTarget)1 FileUploadField (org.apache.wicket.markup.html.form.upload.FileUploadField)1