知道如何做到这一点?
public String bookAction() {
// acctcntr required validation
if (isEmptyNull(_w.getAcctcntr())) {
UIComponent c = getIv1102_combo_box_acctcntr();
showValidationMessage_ByComponent_Key(c,
"iv1102_message_acctcntr_missing");
return null;
}
// vdate required validation
if (isEmptyNull(_w.getVdate())) {
UIComponent c = getIv1102_input_vdate();
showValidationMessage_ByComponent_Key(c,
"iv1102_message_missing_vdate");
return null;
}
// mdate required validation
if (isEmptyNull(_w.getMdate())) {
UIComponent c = getIv1102_input_mdate();
showValidationMessage_ByComponent_Key(c,
"iv1102_message_missing_mdate");
return null;
}
// quantity required validation
if (isEmptyNull(_w.getQuantity())) {
UIComponent c = getIv1102_input_quantity();
showValidationMessage_ByComponent_Key(c,
"iv1102_message_missing_quantity");
return null;
}
// Quantity Exceed Validation
if(_w.getQuantity().doubleValue() > 100000){
showCommonMessageByKey("iv1102_message_quantity_exceed")
}
_w.bookIV();
return "book_success";
}
答案 0 :(得分:0)
只需添加一个标志即可查看是否需要再次执行验证。
if(qExceededValidationRequired && _w.getQuantity().doubleValue() > 100000){
qExceededValidationRequired = false ;
showCommonMessageByKey("iv1102_message_quantity_exceed")
}