use of org.openforis.collect.designer.util.MessageUtil.ConfirmParams 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.openforis.collect.designer.util.MessageUtil.ConfirmParams in project collect by openforis.
the class SurveySelectVM method unpublishSelectedSurvey.
@Command
public void unpublishSelectedSurvey(@ContextParam(ContextType.BINDER) final Binder binder) throws IOException {
final String surveyName = selectedSurvey.getName();
// ask for a confirmation about survey unpublishing
String messageKey = selectedSurvey.isTemporary() ? "survey.unpublish_overwrite_temporary.confirm" : "survey.unpublish.confirm";
MessageUtil.ConfirmParams confirmParams = new MessageUtil.ConfirmParams(new MessageUtil.ConfirmHandler() {
public void onOk() {
// ask for a second confirmation about records deletion
ConfirmParams confirmParams2 = new MessageUtil.ConfirmParams(new MessageUtil.ConfirmHandler() {
public void onOk() {
performSelectedSurveyUnpublishing(binder);
}
});
confirmParams2.setMessage("survey.delete_records.confirm", surveyName);
confirmParams2.setOkLabelKey("survey.unpublish");
confirmParams2.setTitle("survey.unpublish.confirm_title", surveyName);
MessageUtil.showConfirm(confirmParams2);
}
}, messageKey);
confirmParams.setMessage(messageKey, surveyName);
confirmParams.setOkLabelKey("survey.unpublish");
confirmParams.setTitle("survey.unpublish.confirm_title", surveyName);
MessageUtil.showConfirm(confirmParams);
}
Aggregations