use of de.agilecoders.wicket.extensions.markup.html.bootstrap.ladda.LaddaAjaxButton in project ocvn by devgateway.
the class VietnamImportPage method addDoneButton.
protected void addDoneButton() {
doneButton = new LaddaAjaxButton("done", Type.Default) {
private static final long serialVersionUID = 1L;
@Override
protected void onSubmit(final AjaxRequestTarget target, final Form<?> form) {
setResponsePage(Homepage.class);
}
};
doneButton.setDefaultFormProcessing(false);
doneButton.setLabel(new ResourceModel("done"));
doneButton.setDefaultFormProcessing(false);
doneButton.setIconType(FontAwesomeIconType.thumbs_up);
importForm.add(doneButton);
}
use of de.agilecoders.wicket.extensions.markup.html.bootstrap.ladda.LaddaAjaxButton in project ocvn by devgateway.
the class VietnamImportPage method addImportButton.
protected void addImportButton() {
importButton = new LaddaAjaxButton("import", Type.Danger) {
private static final long serialVersionUID = 1L;
@Override
protected void onSubmit(final AjaxRequestTarget target, final Form<?> form) {
send(getPage(), Broadcast.BREADTH, new EditingDisabledEvent());
logText.getSelfUpdatingBehavior().restart(target);
importContainer.setVisibilityAllowed(true);
target.add(importContainer);
target.add(form);
try {
vnExcelImportService.importAllSheets(importForm.getModelObject().getFileTypes(), importForm.getModelObject().getSourceFiles().getPrototypeDatabaseFile().isEmpty() ? null : importForm.getModelObject().getSourceFiles().getPrototypeDatabaseFile().iterator().next().getContent().getBytes(), importForm.getModelObject().getSourceFiles().getLocationsFile().isEmpty() ? null : importForm.getModelObject().getSourceFiles().getLocationsFile().iterator().next().getContent().getBytes(), importForm.getModelObject().getSourceFiles().getPublicInstitutionsSuppliersFile().isEmpty() ? null : importForm.getModelObject().getSourceFiles().getPublicInstitutionsSuppliersFile().iterator().next().getContent().getBytes(), importForm.getModelObject().getSourceFiles().getCityDepartmentGroupFile().isEmpty() ? null : importForm.getModelObject().getSourceFiles().getCityDepartmentGroupFile().iterator().next().getContent().getBytes(), importForm.getModelObject().getDropData(), importForm.getModelObject().getValidateData(), importForm.getModelObject().getFlagData());
} catch (Exception e) {
logger.error(e);
e.printStackTrace();
} finally {
target.add(logText);
target.add(feedbackPanel);
this.setEnabled(false);
target.add(this);
}
}
@Override
protected void onError(final AjaxRequestTarget target, final Form<?> form) {
ValidationError error = new ValidationError();
error.addKey("formHasErrors");
error(error);
target.add(form);
target.add(feedbackPanel);
}
};
importButton.setLabel(new ResourceModel("startImportProcess"));
importButton.setIconType(FontAwesomeIconType.hourglass_start);
importForm.add(importButton);
}
Aggregations