Search in sources :

Example 21 with VoidResult

use of org.activityinfo.legacy.shared.command.result.VoidResult in project activityinfo by bedatadriven.

the class DbListPresenter method update.

private void update(UserDatabaseDTO db, final FormDialogImpl dialog) {
    Map<String, Object> properties = new HashMap<String, Object>();
    properties.put("name", db.getName());
    properties.put("fullName", db.getFullName());
    properties.put("countryId", db.getCountry().getId());
    dispatcher.execute(new UpdateEntity(db.getEntityName(), db.getId(), properties), new SuccessCallback<VoidResult>() {

        @Override
        public void onSuccess(VoidResult arg0) {
            eventBus.fireEvent(AppEvents.SCHEMA_CHANGED);
            loader.load();
            dialog.hide();
        }
    });
}
Also used : UpdateEntity(org.activityinfo.legacy.shared.command.UpdateEntity) VoidResult(org.activityinfo.legacy.shared.command.result.VoidResult) HashMap(java.util.HashMap) SafeHtmlUtils.fromString(com.google.gwt.safehtml.shared.SafeHtmlUtils.fromString)

Example 22 with VoidResult

use of org.activityinfo.legacy.shared.command.result.VoidResult in project activityinfo by bedatadriven.

the class AttachmentsPresenter method onDelete.

public void onDelete() {
    DeleteSiteAttachment attachment = new DeleteSiteAttachment();
    attachment.setBlobId(view.getSelectedItem());
    dispatcher.execute(attachment, new AsyncCallback<VoidResult>() {

        @Override
        public void onFailure(Throwable caught) {
        // callback.onFailure(caught);
        }

        @Override
        public void onSuccess(VoidResult result) {
            view.setActionEnabled(UIActions.DELETE, false);
            view.setAttachmentStore(currentSite.getId());
        }
    });
}
Also used : DeleteSiteAttachment(org.activityinfo.legacy.shared.command.DeleteSiteAttachment) VoidResult(org.activityinfo.legacy.shared.command.result.VoidResult)

Aggregations

VoidResult (org.activityinfo.legacy.shared.command.result.VoidResult)22 AsyncCallback (com.google.gwt.user.client.rpc.AsyncCallback)4 MaskingAsyncMonitor (org.activityinfo.ui.client.dispatch.monitor.MaskingAsyncMonitor)4 FormDialogCallback (org.activityinfo.ui.client.page.common.dialog.FormDialogCallback)3 Record (com.extjs.gxt.ui.client.store.Record)2 UpdateEntity (org.activityinfo.legacy.shared.command.UpdateEntity)2 UpdateMonthlyReports (org.activityinfo.legacy.shared.command.UpdateMonthlyReports)2 UpdateReportSubscription (org.activityinfo.legacy.shared.command.UpdateReportSubscription)2 UpdateSite (org.activityinfo.legacy.shared.command.UpdateSite)2 UpdateUserPermissions (org.activityinfo.legacy.shared.command.UpdateUserPermissions)2 ProjectDTO (org.activityinfo.legacy.shared.model.ProjectDTO)2 FormDialogImpl (org.activityinfo.ui.client.page.common.dialog.FormDialogImpl)2 SqlTransaction (com.bedatadriven.rebar.sql.client.SqlTransaction)1 ButtonEvent (com.extjs.gxt.ui.client.event.ButtonEvent)1 SafeHtmlUtils.fromString (com.google.gwt.safehtml.shared.SafeHtmlUtils.fromString)1 ArrayList (java.util.ArrayList)1 Calendar (java.util.Calendar)1 HashMap (java.util.HashMap)1 CreateLocation (org.activityinfo.legacy.shared.command.CreateLocation)1 DeleteReport (org.activityinfo.legacy.shared.command.DeleteReport)1