Skip to content

Instantly share code, notes, and snippets.

@cortix
Last active August 29, 2015 13:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cortix/9079660 to your computer and use it in GitHub Desktop.
Save cortix/9079660 to your computer and use it in GitHub Desktop.
@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