简体   繁体   English

从ADF中的Manage Bean设置只读属性

[英]Set a Read Only Attribute From Manage Bean In ADF

i wish to set my input attribute to read only once the submit button have been clicked. 我希望将输入属性设置为仅在单击提交按钮后才能读取。 Unfortunately, system can't located where my method was by prompt me this error message 'does not have the property 'validate_submitted''. 不幸的是,系统提示我此错误消息“没有属性” validate_submitted”,因此无法找到我的方法所在的位置。 My code as below 我的代码如下

 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>  

Any suggestion to resolve it? 有什么建议可以解决吗? Thank you very much. 非常感谢你。

You need to name the method getvalidate_submitted (in your bean) so that your page is able to pick up the method. 您需要将方法命名为getvalidate_submitted (在您的bean中),以便您的页面能够使用该方法。

Note that your method name isn't really following the Java naming 'standards'. 请注意,您的方法名称并没有真正遵循Java命名的“标准”。 From the best practice point of view you should name the method getValidateSubmitted and use the following EL #{viewScope.DetailsInvoiceAmountBean.validateSubmitted} 从最佳实践的角度来看,您应该将方法命名为getValidateSubmitted并使用以下EL #{viewScope.DetailsInvoiceAmountBean.validateSubmitted}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM