Skip to content

Instantly share code, notes, and snippets.

@cortix

cortix/fileupload.java

Last active Aug 29, 2015
Embed
What would you like to do?
@SpringBean
User1Dao user1Dao;
private User1 user1 = new User1();
...
final FileUploadField fileUpload = new FileUploadField("fileUpload",new PropertyModel(user1, "photo"));
form.add(fileUpload);
...
AjaxButton submit = new AjaxButton("submit") {
@Override
protected void onError(AjaxRequestTarget target1, Form<?> form) {
feedbackPanel.setVisible(true);
super.onError(target1, form);
target1.add(wrapper);
}
@Override
protected void onSubmit(AjaxRequestTarget ajaxRequestTarget, Form<?> form) {
user1.setConsultantApproval("");
user1Dao.save(user1);
ajaxRequestTarget.add(wrapper);
}
};
form.add(submit);
wrapper.add(form);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment