0
질문이 있습니다. View Object에서 이메일을 확인해야합니다. 이메일이 없으면 일부 코드를 수행합니다. 이메일이 이미 있으면 이메일이 이미 있음을 알리는 메시지가 표시됩니다.ADF에 오류 메시지를 표시 한 후 다음 페이지로 이동하지 않으려면 어떻게합니까?
현재 내가 이미이 메시지를 보내면 "이 이메일은 이미 사용 중입니다"라는 메시지가 전자 메일이있는 경우에 표시됩니다. 하지만 내 문제는이 메시지가 던져지면 사용자는 여전히 다음 페이지로 이동할 수 있다는 것입니다. 그래서이 메시지를 받으면 사용자를 차단하는 방법을 다음 페이지로 이동하십시오.
public void saveAdditionalProfile(ActionEvent event) { {
// saveAndExit()
try {
int rowCount = 0;
ViewObject emailVO1 = appModule.getIwteEmployeeVO1();
currentRow = emailVO1.getCurrentRow();
String strEmail1 = (String)currentRow.getAttribute("Email1");
String SSN = (String)currentRow.getAttribute("Ssn");
rowCount = getEmpCountByEmail(strEmail1, SSN);
if(rowCount == 0){
//have another method here
}
else{
Util.displayErrorMessage("Email has been used.");
}
} catch (Exception e) {
// TODO: Add catch code
e.printStackTrace();
}
}
public static int getEmpCountByEmail(String email, String SSN) {
AppModuleImpl appModule = Util.getAppmodule("AppModuleDataControl");
ViewObjectImpl emailVO = appModule.getIwteEmployeeVO1();
emailVO.setWhereClause("UPPER(Email1) = '" + email.toUpperCase() + "' AND SSN <> '"+ SSN + "'");
emailVO.executeQuery();
emailVO.setWhereClause("");
return emailVO.getRowCount();
}
안녕하세요 ... 답장을 보내 주셔서 감사합니다. 조치를 취할 버튼이 있습니다. 다음 페이지로 데이터를 제출하는 버튼에 조치를 취했습니다. 예 : 버튼 저장 후 다음 작업 조치 수신기 : # {pageFlowScope.profileBean.saveAdditionalProfile} 조치 : 요약 (다음 페이지 호출 요약까지 조치). 액션 리스너는 위의 show 메서드를 호출합니다. 피하기 위해 'break'를 사용할 수 있습니까? –