Search in sources :

Example 6 with FormDialogTether

use of org.activityinfo.ui.client.page.common.dialog.FormDialogTether in project activityinfo by bedatadriven.

the class DbProjectEditor method onAdd.

@Override
protected void onAdd() {
    final ProjectDTO newProject = new ProjectDTO();
    this.view.showAddDialog(newProject, new FormDialogCallback() {

        @Override
        public void onValidated(final FormDialogTether dlg) {
            service.execute(new AddProject(db.getId(), newProject), dlg, new AsyncCallback<CreateResult>() {

                @Override
                public void onFailure(Throwable caught) {
                    MessageBox.alert(I18N.CONSTANTS.error(), I18N.CONSTANTS.errorOnServer(), null);
                }

                @Override
                public void onSuccess(CreateResult result) {
                    newProject.setId(result.getNewId());
                    store.add(newProject);
                    db.getProjects().add(newProject);
                    eventBus.fireEvent(AppEvents.SCHEMA_CHANGED);
                    dlg.hide();
                }
            });
        }
    });
}
Also used : ProjectDTO(org.activityinfo.legacy.shared.model.ProjectDTO) FormDialogCallback(org.activityinfo.ui.client.page.common.dialog.FormDialogCallback) CreateResult(org.activityinfo.legacy.shared.command.result.CreateResult) AddProject(org.activityinfo.legacy.shared.command.AddProject) AsyncCallback(com.google.gwt.user.client.rpc.AsyncCallback) FormDialogTether(org.activityinfo.ui.client.page.common.dialog.FormDialogTether)

Aggregations

FormDialogTether (org.activityinfo.ui.client.page.common.dialog.FormDialogTether)6 FormDialogCallback (org.activityinfo.ui.client.page.common.dialog.FormDialogCallback)5 AsyncCallback (com.google.gwt.user.client.rpc.AsyncCallback)4 CreateResult (org.activityinfo.legacy.shared.command.result.CreateResult)3 ProjectDTO (org.activityinfo.legacy.shared.model.ProjectDTO)3 PartnerDTO (org.activityinfo.legacy.shared.model.PartnerDTO)2 Record (com.extjs.gxt.ui.client.store.Record)1 AddProject (org.activityinfo.legacy.shared.command.AddProject)1 AddTarget (org.activityinfo.legacy.shared.command.AddTarget)1 UpdateEntity (org.activityinfo.legacy.shared.command.UpdateEntity)1 UpdatePartner (org.activityinfo.legacy.shared.command.UpdatePartner)1 DuplicateCreateResult (org.activityinfo.legacy.shared.command.result.DuplicateCreateResult)1 VoidResult (org.activityinfo.legacy.shared.command.result.VoidResult)1 TargetDTO (org.activityinfo.legacy.shared.model.TargetDTO)1 FormDialogImpl (org.activityinfo.ui.client.page.common.dialog.FormDialogImpl)1 PartnerForm (org.activityinfo.ui.client.page.config.form.PartnerForm)1