use of org.zkoss.bind.annotation.Command in project collect by openforis.
the class SurveyObjectBaseVM method deleteItem.
@Command
public void deleteItem(@BindingParam("item") final T item) {
MessageUtil.ConfirmParams params = new MessageUtil.ConfirmParams(new ConfirmHandler() {
@Override
public void onOk() {
performDeleteItem(item);
}
}, getConfirmDeleteMessageKey());
params.setOkLabelKey("global.delete_item");
MessageUtil.showConfirm(params);
}
use of org.zkoss.bind.annotation.Command 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