2015-06-23 41 views
0
  1. 用戶填寫跳過
  2. 的圖書按鈕,用戶點擊
  3. 系統驗證表單
  4. 當系統達到這個驗證(數量超越驗證),它將顯示常用信息(數量超過100000.再次點擊預訂以繼續預訂。)
  5. 用戶再次點擊預約按鈕。 系統可以再次重新驗證表單,但跳過/忽略驗證(數量超出驗證)。

任何想法如何做到這一點?如何允許驗證,在某些情況下,在形式

  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

你特別在掙扎着什麼?你給了我們一份任務清單和一些代碼(沒有解釋它指的是什麼)。你究竟在爲什麼而掙扎? – amit

+0

@amit對不起。我突出了我正在大膽掙扎的那部分。 – bittersour

+0

只需添加一個標誌來查看是否需要再次執行驗證。 – KDM

回答

0

只需添加一個標誌來查看驗證是否需要再次執行。

if(qExceededValidationRequired && _w.getQuantity().doubleValue() > 100000){ 
     qExceededValidationRequired = false ; 
     showCommonMessageByKey("iv1102_message_quantity_exceed") 
    }  
相關問題