Search in sources :

Example 1 with FormDialogImpl

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

the class DbListPresenter method onAdd.

public void onAdd() {
    final UserDatabaseDTO db = new UserDatabaseDTO();
    DatabaseForm form = new DatabaseForm(dispatcher);
    form.getBinding().bind(db);
    final FormDialogImpl dialog = new FormDialogImpl(form);
    dialog.setWidth(400);
    dialog.setHeight(200);
    dialog.setHeading(I18N.CONSTANTS.newDatabase());
    dialog.show(new FormDialogCallback() {

        @Override
        public void onValidated() {
            save(db, dialog);
        }
    });
}
Also used : FormDialogImpl(org.activityinfo.client.page.common.dialog.FormDialogImpl) FormDialogCallback(org.activityinfo.client.page.common.dialog.FormDialogCallback) UserDatabaseDTO(org.activityinfo.shared.dto.UserDatabaseDTO) DatabaseForm(org.activityinfo.client.page.config.form.DatabaseForm)

Example 2 with FormDialogImpl

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

the class DbPartnerGrid method showAddDialog.

@Override
public FormDialogTether showAddDialog(PartnerDTO partner, FormDialogCallback callback) {
    PartnerForm form = new PartnerForm();
    form.getBinding().bind(partner);
    FormDialogImpl dlg = new FormDialogImpl(form);
    dlg.setWidth(450);
    dlg.setHeight(300);
    dlg.setHeading(messages.newPartner());
    dlg.show(callback);
    return dlg;
}
Also used : PartnerForm(org.activityinfo.client.page.config.form.PartnerForm) FormDialogImpl(org.activityinfo.client.page.common.dialog.FormDialogImpl)

Example 3 with FormDialogImpl

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

the class DbProjectEditor method onEdit.

@Override
protected void onEdit(final ProjectDTO model) {
    final FormDialogImpl<ProjectForm> dialog = new FormDialogImpl<ProjectForm>(new ProjectForm());
    dialog.setWidth(450);
    dialog.setHeight(300);
    dialog.getForm().getBinding().bind(model);
    dialog.show(new FormDialogCallback() {

        @Override
        public void onValidated() {
            service.execute(RequestChange.update(model, "name", "description"), dialog, new AsyncCallback<VoidResult>() {

                @Override
                public void onFailure(Throwable caught) {
                // handled by monitor
                }

                @Override
                public void onSuccess(VoidResult result) {
                    dialog.hide();
                    eventBus.fireEvent(AppEvents.SCHEMA_CHANGED);
                    view.refresh();
                }
            });
        }
    });
}
Also used : ProjectForm(org.activityinfo.client.page.config.form.ProjectForm) FormDialogImpl(org.activityinfo.client.page.common.dialog.FormDialogImpl) FormDialogCallback(org.activityinfo.client.page.common.dialog.FormDialogCallback) VoidResult(org.activityinfo.shared.command.result.VoidResult) AsyncCallback(com.google.gwt.user.client.rpc.AsyncCallback)

Example 4 with FormDialogImpl

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

the class DbUserEditor method add.

private void add() {
    final UserForm form = new UserForm(db);
    final FormDialogImpl dlg = new FormDialogImpl(form);
    dlg.setHeading(I18N.CONSTANTS.newUser());
    dlg.setWidth(400);
    dlg.setHeight(300);
    final String host = Window.Location.getHostName();
    dlg.show(new FormDialogCallback() {

        @Override
        public void onValidated() {
            dispatcher.execute(new UpdateUserPermissions(db, form.getUser(), host), dlg, new AsyncCallback<VoidResult>() {

                @Override
                public void onFailure(Throwable caught) {
                }

                @Override
                public void onSuccess(VoidResult result) {
                    loader.load();
                    dlg.hide();
                }
            });
        }
    });
}
Also used : FormDialogImpl(org.activityinfo.client.page.common.dialog.FormDialogImpl) FormDialogCallback(org.activityinfo.client.page.common.dialog.FormDialogCallback) VoidResult(org.activityinfo.shared.command.result.VoidResult) UpdateUserPermissions(org.activityinfo.shared.command.UpdateUserPermissions) AsyncCallback(com.google.gwt.user.client.rpc.AsyncCallback) UserForm(org.activityinfo.client.page.config.form.UserForm)

Example 5 with FormDialogImpl

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

the class DbProjectGrid method showAddDialog.

@Override
public FormDialogTether showAddDialog(ProjectDTO project, FormDialogCallback callback) {
    ProjectForm form = new ProjectForm();
    form.getBinding().bind(project);
    FormDialogImpl<ProjectForm> dlg = new FormDialogImpl<ProjectForm>(form);
    dlg.setWidth(450);
    dlg.setHeight(300);
    dlg.setHeading(messages.createProject());
    dlg.show(callback);
    return dlg;
}
Also used : ProjectForm(org.activityinfo.client.page.config.form.ProjectForm) FormDialogImpl(org.activityinfo.client.page.common.dialog.FormDialogImpl)

Aggregations

FormDialogImpl (org.activityinfo.client.page.common.dialog.FormDialogImpl)8 FormDialogCallback (org.activityinfo.client.page.common.dialog.FormDialogCallback)4 AsyncCallback (com.google.gwt.user.client.rpc.AsyncCallback)2 ProjectForm (org.activityinfo.client.page.config.form.ProjectForm)2 VoidResult (org.activityinfo.shared.command.result.VoidResult)2 FieldBinding (com.extjs.gxt.ui.client.binding.FieldBinding)1 FormEvent (com.extjs.gxt.ui.client.event.FormEvent)1 HiddenField (com.extjs.gxt.ui.client.widget.form.HiddenField)1 DatabaseForm (org.activityinfo.client.page.config.form.DatabaseForm)1 PartnerForm (org.activityinfo.client.page.config.form.PartnerForm)1 TargetForm (org.activityinfo.client.page.config.form.TargetForm)1 UserForm (org.activityinfo.client.page.config.form.UserForm)1 UpdateUserPermissions (org.activityinfo.shared.command.UpdateUserPermissions)1 ActivityDTO (org.activityinfo.shared.dto.ActivityDTO)1 AttributeDTO (org.activityinfo.shared.dto.AttributeDTO)1 AttributeGroupDTO (org.activityinfo.shared.dto.AttributeGroupDTO)1 IndicatorDTO (org.activityinfo.shared.dto.IndicatorDTO)1 UserDatabaseDTO (org.activityinfo.shared.dto.UserDatabaseDTO)1