use of org.zkoss.bind.annotation.Command in project collect by openforis.
the class CalculatedAttributeVM method deleteFormula.
@Command
@NotifyChange({ "selectedFormula", "formulas" })
public void deleteFormula() {
ConfirmParams params = new MessageUtil.ConfirmParams(new MessageUtil.ConfirmHandler() {
@Override
public void onOk() {
editedItem.removeFormula(selectedFormula);
selectedFormula = null;
initFormulas();
notifyChange("selectedFormula", "formulas");
}
}, "survey.schema.attribute.calculated.formula.confirm_delete");
params.setOkLabelKey("global.delete_item");
MessageUtil.showConfirm(params);
}
use of org.zkoss.bind.annotation.Command in project collect by openforis.
the class CalculatedAttributeVM method addFormula.
@Command
@NotifyChange("formulas")
public void addFormula() {
editingNewFormula = true;
editedFormula = new Formula();
openFormulaEditPopUp();
}
use of org.zkoss.bind.annotation.Command in project collect by openforis.
the class TabsGroupComposer method addTab.
@Command
@NotifyChange({ "tabs" })
public void addTab() {
UITab tab = new UITab();
String tabName = generateNewTabName(tabsGroup);
tab.setName(tabName);
tabsGroup.addTab(tab);
}
use of org.zkoss.bind.annotation.Command in project collect by openforis.
the class SurveyEditVM method exportSchemaSummary.
@Command
public void exportSchemaSummary() {
SchemaSummaryCSVExportJob job = new SchemaSummaryCSVExportJob();
job.setJobManager(jobManager);
job.setSurvey(survey);
job.setLabelLanguage(currentLanguageCode);
jobManager.start(job, survey.getId().toString());
String statusPopUpTitle = Labels.getLabel("survey.schema.export_summary.process_status_popup.message", new String[] { survey.getName() });
jobStatusPopUp = JobStatusPopUpVM.openPopUp(statusPopUpTitle, job, true);
}
use of org.zkoss.bind.annotation.Command in project collect by openforis.
the class SurveyEditVM method exportCEGridTemplate.
@Command
public void exportCEGridTemplate() throws IOException {
File templateFile = new CollectEarthGridTemplateGenerator().generateTemplateCSVFile(survey);
String fileName = String.format("%s_grid_template_%s.csv", survey.getName(), Dates.formatDateTime(new Date()));
Filedownload.save(new FileInputStream(templateFile), MediaTypes.CSV_CONTENT_TYPE, fileName);
}
Aggregations