Search in sources :

Example 1 with SiteDialogLauncher

use of org.activityinfo.client.page.entry.form.SiteDialogLauncher 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();
    }
}
Also used : SiteDialogLauncher(org.activityinfo.client.page.entry.form.SiteDialogLauncher) SiteDTO(org.activityinfo.shared.dto.SiteDTO) PrintDataEntryForm(org.activityinfo.client.page.entry.form.PrintDataEntryForm) SiteDialogCallback(org.activityinfo.client.page.entry.form.SiteDialogCallback)

Aggregations

PrintDataEntryForm (org.activityinfo.client.page.entry.form.PrintDataEntryForm)1 SiteDialogCallback (org.activityinfo.client.page.entry.form.SiteDialogCallback)1 SiteDialogLauncher (org.activityinfo.client.page.entry.form.SiteDialogLauncher)1 SiteDTO (org.activityinfo.shared.dto.SiteDTO)1