use of com.extjs.gxt.ui.client.event.FormEvent in project activityinfo by bedatadriven.
the class AttachmentsPresenter method onUpload.
public void onUpload() {
form = new AttachmentForm();
form.setEncoding(Encoding.MULTIPART);
form.setMethod(Method.POST);
HiddenField<String> blobField = new HiddenField<String>();
blobField.setName("blobId");
blobid = UUID.uuid();
blobField.setValue(blobid);
form.add(blobField);
final FormDialogImpl dialog = new FormDialogImpl(form);
dialog.setWidth(400);
dialog.setHeight(200);
dialog.setHeadingText(I18N.CONSTANTS.newAttachment());
dialog.show(new FormDialogCallback() {
@Override
public void onValidated() {
form.setAction("/ActivityInfo/attachment?blobId=" + blobid + "&siteId=" + currentSite.getId());
form.submit();
dialog.getSaveButton().setEnabled(false);
}
});
form.addListener(Events.Submit, new Listener<FormEvent>() {
@Override
public void handleEvent(FormEvent event) {
dialog.hide();
view.setAttachmentStore(currentSite.getId());
}
});
}
Aggregations