如何在 adf 12c 中以编程方式在输入框中设置值

How to set value in input box programmatically in adf 12c

我正在使用 12c 数据库在 adf 12c 中开发应用程序。 我想以编程方式在输入框中设置值,我尝试了以下代码,但这没有用。

调用函数的输入框和按钮代码如下:

<af:inputText value="#{bindings.Image.inputValue}" 
  label="Picture DB" rendered="true" simple="true" 
  required="#{bindings.Image.hints.mandatory}" 
  columns="#{bindings.Image.hints.displayWidth}" 
  maximumLength="#{bindings.Image.hints.precision}" 
  shortDesc="#{bindings.Image.hints.tooltip}" id="it66" 
  binding="#{FileManageBean.dbValue}">
 <f:validator binding="#{bindings.Image.validator}"/>
</af:inputText>

<af:button text="button 1" id="b2" action="#{FileManageBean.fileUpload}"/>

这里是class和函数的代码:

public class File_Upl_Dwn {
    private RichInputText dbValue;

    public File_Upl_Dwn() {
        super();
    }


    public String fileUpload() { 

      //First Method I tried, but didn't worked
      getDbValue().setValue("gogog"); 
      AdfFacesContext adffacescontext1 = AdfFacesContext.getCurrentInstance();
      adffacescontext1.addPartialTarget(dbValue); 

      //Second Method I tried, but didn't worked
      getDbValue().setValue("sfdd");
      AdfFacesContext.getCurrentInstance().addPartialTarget(getDbValue());
      return "ok";
    }

    public void setDbValue(RichInputText dbValue) {
        this.dbValue = dbValue;
    }

    public RichInputText getDbValue() {
        return dbValue;
    }
}

任何有关如何以编程方式在输入框中输入值的帮助将不胜感激。

尝试在按钮中添加partialSubmit="true",在inputText中添加部分触发器partialTriggers="b2"指的是按钮

<af:inputText value="#{bindings.Image.inputValue}" 
  label="Picture DB" rendered="true" simple="true"  
  required="#{bindings.Image.hints.mandatory}" 
  columns="#{bindings.Image.hints.displayWidth}" 
  maximumLength="#{bindings.Image.hints.precision}"  partialTriggers="b2"
  shortDesc="#{bindings.Image.hints.tooltip}" id="it66" 
  binding="#{FileManageBean.dbValue}">
 <f:validator binding="#{bindings.Image.validator}"/>
</af:inputText>


<af:button  text="button 1" id="b2" action="#{FileManageBean.fileUpload}" partialSubmit="true"/>