Search in sources :

Example 1 with UserForm

use of org.activityinfo.client.page.config.form.UserForm 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)

Aggregations

AsyncCallback (com.google.gwt.user.client.rpc.AsyncCallback)1 FormDialogCallback (org.activityinfo.client.page.common.dialog.FormDialogCallback)1 FormDialogImpl (org.activityinfo.client.page.common.dialog.FormDialogImpl)1 UserForm (org.activityinfo.client.page.config.form.UserForm)1 UpdateUserPermissions (org.activityinfo.shared.command.UpdateUserPermissions)1 VoidResult (org.activityinfo.shared.command.result.VoidResult)1