2014-09-24 58 views
0

我希望將我的輸入屬性設置爲只讀提交按鈕被單擊後的只讀屬性。不幸的是,通過提示我這個錯誤消息'沒有屬性'validate_submitted'',系統無法找到我的方法所在的位置。我的代碼如下從ADF中的管理Bean中設置一個只讀屬性

In Manage Bean: 
     public boolean validate_submitted(){ 
    Number temp = pa_header_row.getSubmitted(); 
    if (temp != null && temp.intValue() == 1) 
    { 
     return true; 
    }  
     return false;   
    } 

    In the field: 
    <af:inputDate value="#{bindings.InvoiceDate.inputValue}" 
          label="Invoice Date" 
          shortDesc="#{bindings.InvoiceDate.hints.tooltip}" 
          id="id2" 
          readOnly="#{viewScope.DetailsInvoiceAmountBean.validate_submitted}"> 
       <f:validator binding="#{bindings.InvoiceDate.validator}"/> 
       <af:convertDateTime pattern="#{bindings.InvoiceDate.format}"/> 
       </af:inputDate> 

任何建議來解決它?非常感謝你。

回答

1

您需要命名方法getvalidate_submitted(在您的bean中),以便您的頁面能夠選取該方法。

請注意,您的方法名稱並非真正遵循Java命名「標準」。從最佳做法的角度來看,您應該命名方法getValidateSubmitted並使用以下EL #{viewScope.DetailsInvoiceAmountBean.validateSubmitted}

+0

嗨,我找到了解決方法已經。因爲在ADF中,read屬性不能提取該方法。管理bean中的方法僅在動作偵聽器中可用。無論如何,thxz爲你的幫助。 – goh6319 2014-09-24 07:53:12