use of org.zkoss.bind.annotation.GlobalCommand in project collect by openforis.
the class CodeAttributeVM method codeListsPopUpClosed.
@GlobalCommand
public void codeListsPopUpClosed(@ContextParam(ContextType.BINDER) Binder binder, @BindingParam(CodeListsVM.EDITING_ATTRIBUTE_PARAM) Boolean editingAttribute, @BindingParam(CodeListsVM.SELECTED_CODE_LIST_PARAM) CodeList selectedCodeList) {
if (editingAttribute && selectedCodeList != null) {
CodeAttributeDefinitionFormObject fo = (CodeAttributeDefinitionFormObject) getFormObject();
CodeList oldList = fo.getList();
if (oldList != null && !oldList.equals(selectedCodeList)) {
if (oldList != survey.getSamplingDesignCodeList()) {
confirmCodeListChange(binder, selectedCodeList);
}
} else {
onListChanged(binder, selectedCodeList);
validateForm(binder);
}
}
}
use of org.zkoss.bind.annotation.GlobalCommand in project collect by openforis.
the class SurveyExportParametersVM method jobCompleted.
@GlobalCommand
public void jobCompleted(@BindingParam("job") Job job) {
boolean jobStartedByThis = isJobStartedByThis(job);
if (job == surveyBackupJob) {
File file = surveyBackupJob.getOutputFile();
downloadFile(file, surveyBackupJob.getOutputFormat().getOutputFileExtension(), MediaType.APPLICATION_OCTET_STREAM_VALUE, surveyBackupJob.getSurvey(), surveyBackupJob.getOutputSurveyDefaultLanguage());
final List<DataBackupError> dataBackupErrors = surveyBackupJob.getDataBackupErrors();
if (!dataBackupErrors.isEmpty()) {
DataExportErrorsPopUpVM.showPopUp(dataBackupErrors);
}
} else if (job == rdbExportJob) {
File file = rdbExportJob.getOutputFile();
CollectSurvey survey = rdbExportJob.getSurvey();
String extension = "sql";
downloadFile(file, extension, MediaType.TEXT_PLAIN_VALUE, survey, survey.getDefaultLanguage());
}
if (jobStartedByThis) {
onJobEnd(job);
}
}
use of org.zkoss.bind.annotation.GlobalCommand in project collect by openforis.
the class SurveySelectVM method jobCompleted.
@GlobalCommand
public void jobCompleted(@BindingParam("job") Job job) {
boolean jobStartedByThis = isJobStartedByThis(job);
if (job == surveyCloneJob) {
CollectSurvey survey = surveyCloneJob.getOutputSurvey();
surveyCloneJob = null;
SurveyEditVM.redirectToSurveyEditPage(survey.getId());
}
if (jobStartedByThis) {
onJobEnd(job);
}
}
Aggregations