use of org.activityinfo.client.page.entry.form.SiteDialogCallback in project activityinfo by bedatadriven.
the class DataEntryPage method onUIAction.
@Override
public void onUIAction(String actionId) {
if (UIActions.ADD.equals(actionId)) {
SiteDialogLauncher formHelper = new SiteDialogLauncher(dispatcher);
formHelper.addSite(currentPlace.getFilter(), new SiteDialogCallback() {
@Override
public void onSaved(SiteDTO site) {
gridPanel.refresh();
}
});
} else if (UIActions.EDIT.equals(actionId)) {
SiteDialogLauncher launcher = new SiteDialogLauncher(dispatcher);
launcher.editSite(gridPanel.getSelection(), new SiteDialogCallback() {
@Override
public void onSaved(SiteDTO site) {
gridPanel.refresh();
}
});
} else if (UIActions.DELETE.equals(actionId)) {
delete();
} else if (UIActions.PRINT.equals(actionId)) {
int activityId = currentPlace.getFilter().getRestrictedCategory(DimensionType.Activity);
PrintDataEntryForm form = new PrintDataEntryForm(dispatcher);
form.print(activityId);
} else if (UIActions.EXPORT.equals(actionId)) {
Window.Location.assign(GWT.getModuleBaseURL() + "export?filter=" + FilterUrlSerializer.toUrlFragment(currentPlace.getFilter()));
} else if ("EMBED".equals(actionId)) {
EmbedDialog dialog = new EmbedDialog(dispatcher);
dialog.show(currentPlace);
} else if ("IMPORT".equals(actionId)) {
doImport();
}
}
Aggregations