コード例 #1
0
ファイル: AddSurveyView.java プロジェクト: caihaoyu/wds
 public String confirmAddNewSurvey() {
   FacesContext context = FacesContext.getCurrentInstance();
   newSurvey.setDatecreated(Calendar.getInstance().getTime());
   newSurvey = surveyManager.saveSurvey(newSurvey);
   editSurveySession.refreshSurveyList();
   String msg = "New survey: \"" + newSurvey.getSurveytitle() + "\" added.";
   context.getExternalContext().getFlash().putNow("msg", msg);
   return "editSurvey";
 }
コード例 #2
0
ファイル: AddSurveyView.java プロジェクト: caihaoyu/wds
 public void addNewSurvey() {
   RequestContext rqContext = RequestContext.getCurrentInstance();
   if (surveyManager.loadSurveyBySurveyTitle(newSurvey.getSurveytitle()) != null) {
     warnPopContent = "Cannot create survey, survey with the same name already exist.";
     rqContext.execute("warndl.show()");
   } else {
     rqContext.execute("confirmAddSurveyDialog.show()");
   }
 }